Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.linux.slackware > #35691

Re: Survey: What do you run first after you boot Slackware?

From jayjwa <jayjwa@atr2.ath.cx.invalid>
Newsgroups alt.os.linux.slackware
Subject Re: Survey: What do you run first after you boot Slackware?
Date 2026-07-07 10:18 -0400
Organization atr2net 2026
Message-ID <87bjcikhmb.fsf@atr2.ath.cx> (permalink)
References <111jsv9$3vd70$1@dont-email.me> <112ggqt$219e8$1@dont-email.me> <112i2tp$2khjf$1@dont-email.me>

Show all headers | View raw


Henrik Carlqvist <Henrik.Carlqvist@deadspam.com> writes:

> Since a few years, ntpd has the option "-g" which no longer would make it 
> necessary to call ntpdate before ntpd.
ntpd, on Current at least, has its startup script pull in
/etc/default/ntp, in which you can set the "-g" option. It might be the
default for all I know. This is mine:

NTPD_OPTS="-g -p /run/ntpd.pid -u ntp:ntp"

Since I'm answering this thread anyway, here's my rc.local:
#!/bin/bash
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

# Make sure these filesystems have the proper attributes as
# per /etc/fstab. Mounting efivarfs with rw enabled is dangerous.
mount -o remount efivarfs
mount -o remount proc

if [ -x /etc/rc.d/rc.redis ]; then
  # Start Redis daemon
  echo "Starting Redis daemon:    /etc/rc.d/rc.redis start"
  /etc/rc.d/rc.redis start
fi

# Pulse Audio has a HOME set in /etc/passwd, but no actual 
# directory corresponding to it. Create it now.
mkdir -p /var/run/pulse
chgrp pulse /var/run/pulse

# Start system monitoring daemon as root. It will drop privs.
# If it is started by a user and gets whacked, they will get
# user privs of that user. Better to be run as 'nobody'.
# See /etc/gkrellmd.conf for options
gkrellmd

## EOF

Explaination: for some reason, efivars remains r/w by default. If it
stays that way, an errant command that writes into the /sys area where
the efivars are could scribble over them, bricking the firmware.

efivarfs	/sys/firmware/efi/efivars efivarfs	noauto,ro	

For /proc, I use 'hidepid' so users can't spy each other's command
lines. For some reason, this doesn't keep set even though it's in fstab:
proc            /proc            	proc        	hidepid=2

Checking the passwd file (pwck) will generate an error for user 'pulse'
due to no home being there on startup because it gets deleted on reboot,
so that fixes that issue. Redis and gkrellmd are self-explainitory.

After that, in /etc/default/tmp-cleanup, I have:
# You may also run a custom cleanup script by pointing to it here:
TMP_REMOVE_SCRIPT=/usr/local/sbin/mightytidy.py

Which was posted to LQ in a thread about said topic and is duplicated
here:

#!/usr/bin/python3
## Remove various temporary files from the system. Ideally, these
## files are left over from applications that do not remove their
## own temp files on closure. This script should be run at boot
## time, hooked into the system startup scripts.
##
## $Id: mightytidy.py,v 1.2 2025/11/06 17:19:35 jayjwa Exp $
import re
import os
import shutil

# The file regexes to search for, in an expandable list. Uses raw strings.
# See https://thepythonguru.com/python-regular-expression/index.html .
hitList = [ r'chaos_stream$', r'chaos_packet$', r'dolphin\.[a-zA-Z0-9]{6}$',
            r'dbus-[a-zA-Z0-9]{10}$', r'hsperfdata_\w+$', r'u*screens$',
            r'MozillaBackgroundTask-[a-zA-Z0-9]{16}-removeDirectory$',
            r'gimp$', r'i2p-.{8}\.tmp$', r'tmux-[0-9]+$', r'mozilla_[a-zA-Z0-9]+$',
            r'palemoon_\w+$', r'\.wine-[0-9]+$', r'.mount_libre[a-zA-Z]+$',
            r'.xrdp$', r'decnetapi.sock$' ]

# Whether to actually delete objects or not. Useful for debugging.
# False = delete, True = don't really delete (dry run)
dryRun = False

def cleanTmp():
    '''Remove various items from system tmp directory that match a set list.'''
    TEMP = "/tmp"
    # Walk the TEMP directory to find present entities
    for currentEntry in os.listdir( TEMP ):
        for possibleMatch in hitList:
            # Match pattern against directory content
            if re.match( possibleMatch, currentEntry ):
                # Is it a directorty? Call shutil.rmtree on it. shutil
                # won't bark if we can't actually delete it for some reason
                if os.path.isdir( os.path.join( TEMP, currentEntry ) ):
                    if dryRun:
                        print( f"Directory match on {os.path.join( TEMP, currentEntry )}" )
                    else:
                        shutil.rmtree( os.path.join( TEMP, currentEntry ), ignore_errors=True )
                # It is a file or socket. Use os.remove, ignore errors
                # if we can't remove it
                else:
                    if dryRun:
                        print( f"File match on {os.path.join( TEMP, currentEntry )}" )
                    else:
                        try:
                            os.remove( os.path.join( TEMP, currentEntry ) )
                        except:
                            pass

                        
if __name__ == "__main__":
    cleanTmp()

## $Log: mightytidy.py,v $
## Revision 1.2  2025/11/06 17:19:35  jayjwa
## Add decnetapi.sock (pydecnet) file to hitlist so that pydecnet starts
## on reboot without manual intervention to remove said file.
##
## Revision 1.1  2025/09/27 17:54:11  jayjwa
## Initial revision
##

## EOF

You can increase 'hitList' as needed. Personally, I like to keep /tmp
until I decide to remove things from it because I park files there
alot. The script only deletes junk that gets left behind and nothing
else. 

After *that*, I start Privoxy + Tor + I2p routers for darknet
access. Other networking protocols I start by hand, just in case
something breaks. 

-- 
PGP Key ID: 781C A3E2 C6ED 70A6 B356  7AF5 B510 542E D460 5CAE
       "The Internet should always be the Wild West!"

Back to alt.os.linux.slackware | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Survey:  What do you run first after you boot Slackware? Joseph Rosevear <Mail@JoesLife.org> - 2026-06-25 18:44 +0000
  Re: Survey:  What do you run first after you boot Slackware? Sylvain Robitaille <syl@therockgarden.ca> - 2026-06-25 21:19 +0000
    Re: Survey:  What do you run first after you boot Slackware? Joseph Rosevear <Mail@JoesLife.org> - 2026-06-25 22:36 +0000
      Re: Survey:  What do you run first after you boot Slackware? Sylvain Robitaille <syl@therockgarden.ca> - 2026-06-26 21:38 +0000
        Re: Survey:  What do you run first after you boot Slackware? Joseph Rosevear <Mail@JoesLife.org> - 2026-06-29 00:17 +0000
  Re: Survey:  What do you run first after you boot Slackware? Lumin Etherlight <lumin+usenet@etherlight.link> - 2026-06-27 21:41 +0300
    Re: Survey:  What do you run first after you boot Slackware? Joseph Rosevear <Mail@JoesLife.org> - 2026-06-29 01:02 +0000
  Re: Survey:  What do you run first after you boot Slackware? David Chmelik <dchmelik@gmail.com> - 2026-07-03 06:57 +0000
    Re: Survey:  What do you run first after you boot Slackware? Joseph Rosevear <Mail@JoesLife.org> - 2026-07-04 00:36 +0000
      Re: Survey:  What do you run first after you boot Slackware? Henrik Carlqvist <Henrik.Carlqvist@deadspam.com> - 2026-07-06 05:50 +0000
  Re: Survey:  What do you run first after you boot Slackware? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-07-06 15:15 +0000
    Re: Survey:  What do you run first after you boot Slackware? Henrik Carlqvist <Henrik.Carlqvist@deadspam.com> - 2026-07-07 05:30 +0000
      Re: Survey:  What do you run first after you boot Slackware? jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-07-07 10:18 -0400

csiph-web