Slackware Linux Post-installation

assuming network configuration is already done

those steps are otherwise partly automated by the linuxconf script

Daemons

are you clean?

netstat -lntup

secure SSHD for group wheel and reload

/etc/rc.d/rc.sshd restart

Environment

cp -pi /etc/profile /etc/profile.dist
vi /etc/profile

system-wide path

PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/sbin:/usr/sbin:/sbin
PATH=$PATH:/etc/rc.d:$HOME/bin
PATH=$PATH:/usr/lib64/bcc:/data/xen
#PATH=/usr/lib64/binutils2.33.1/bin:$PATH

and remove the user-specific part. then at the bottom

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
j=$((`grep ^processor /proc/cpuinfo | tail -1 | awk '{print $3}'` + 1))
export MAKEFLAGS=-j$j

case "$-" in *i*)
    alias ll='ls -alF'
    alias cp='cp -i'
    alias mv='mv -i'
    alias rm='rm -i'
    alias neta='netstat -antup'
    alias netl='netstat -lntup'
    #alias runq='postfix flush'
    alias clean="egrep -v '^[[:space:]]*(#|$)'"
    alias lynx='lynx -accept_all_cookies'
    alias lynxg='lynx -accept_all_cookies google.com/ncr'
    alias push='git nc && git push'
    alias stat='git diff --stat --cached origin/master'
    ;;
esac

source /etc/profile

loose the too-many shell features

#mkdir ~/.trash/
#mv /etc/profile.d/modules.* ~/.trash/

look for /usr/local/lib

cat /etc/ld.so.conf

Booting

LILO speedup (physical host)

cd /etc/
mv -i lilo.conf lilo.conf.dist
sed -r '/^[[:space:]]*(#|$)/d' lilo.conf.dist > lilo.conf
vi lilo.conf

lba32
...
#timeout = 1200
timeout = 50

lilo

can’t ask for /var/log/*/* because it would open too many files (/var/log/packages/*)

cd ~/
echo 'tail -n0 -F /var/log/*' > log
chmod +x log
./log

Miscellaneous

Get rid of unnecessary log MARKs

cp -pi /etc/rc.d/rc.syslog /etc/rc.d/rc.syslog.dist
chmod -x /etc/rc.d/rc.syslog.dist
vi /etc/rc.d/rc.syslog

SYSLOGD_OPTIONS="-m0 "

/etc/rc.d/rc.syslog restart

Indexing

updatedb

Sync the hardware clock once –or– eventually keep being in sync

#ntpdate -u ntp.obspm.fr
ntpdate -u ru.pool.ntp.org
hwclock --utc --systohc

Fixing defaults for git ($HOST short hostname is evaluated only if you have an FQDN, while $HOSTNAME always works)

#git config --global --replace-all core.pager more
git config --global core.pager "less -r"
echo $USER@$HOSTNAME
git config user.name "$HOSTNAME"
git config user.email "$USER@$HOSTNAME"

Packages management

mv -i /etc/slackpkg/mirrors /etc/slackpkg/mirrors.dist
vi /etc/slackpkg/mirrors

# FRANCE
# http://nephtys.lip6.fr/pub/linux/distributions/slackware/slackware64-14.2/

# RUSSIA
# http://mirror.rol.ru/slackware/slackware64-14.2/
# http://mirror.yandex.ru/slackware/slackware64-14.2/

# LAN
# http://x.x.x.x/slackware142/

# LOCAL
# file:///tftpboot/slackware142/

slackpkg update
slackpkg search htop

System Upgrade

BEFORE we proceed, let’s get rid of all useless .orig files

updatedb
locate \.orig | grep \.orig$
locate \.orig | grep \.orig$ | xargs rm -f
locate \.new | grep new$

yes, we are loosing those also, but it does not matter

/usr/share/xml/docbook/xsl-stylesheets-1.78.1/fo/lists.xsl.orig
/usr/share/xml/docbook/xsl-stylesheets-1.78.1/fo/param.xsl.orig
/usr/share/xml/docbook/xsl-stylesheets-1.78.1/fo/pagesetup.xsl.orig
/usr/share/xml/docbook/xsl-stylesheets-1.78.1/html/param.xsl.orig
/usr/share/elvis-2.2_0/elvis.clr.orig
/usr/share/sendmail/cf/cf/Build.orig
/usr/doc/libidn-1.30/contrib/doxygen/Doxyfile.orig

slackpkg upgrade-all

(O)verwrite all old files

updatedb
locate \.orig | grep \.orig$

restoring custom sshd_config on systems to be truly secured – we don’t really care for clusters and isolated networks

diff -bu /etc/ssh/sshd_config.dist /etc/ssh/sshd_config
mv -f /etc/ssh/sshd_config /etc/ssh/sshd_config.dist
mv -f /etc/ssh/sshd_config.orig /etc/ssh/sshd_config
sshd -t && echo ALL FINE
rc.sshd restart

btw, certificates conf might have been updated

diff -bu /etc/ca-certificates.conf.orig /etc/ca-certificates.conf
update-ca-certificates

now clean-up everything what’s left

locate \.orig | grep \.orig$ | xargs rm -f

and re-check

updatedb
locate \.orig | grep \.orig$

Third-parity Packages

Grab & install the latest slackpkg+ release

cd ~/
wget http://slakfinder.org/slackpkg+/pkg/slackpkg+-1.7.0-noarch-10mt.txz
installpkg --terse slackpkg+-1.7.0-noarch-10mt.txz
cp -pi /etc/slackpkg/slackpkgplus.conf /etc/slackpkg/slackpkgplus.conf.dist
vi /etc/slackpkg/slackpkgplus.conf

REPOPLUS=( slackpkgplus slackonly )
MIRRORPLUS['slackonly']=http://packages.slackonly.com/pub/packages/14.2-x86_64/

slackpkg update gpg
slackpkg update
slackpkg search bonnie++

System Tuning

Some hardware checking

grep '^model name' /proc/cpuinfo | uniq
grep ^proc /proc/cpuinfo
free -m
hdparm -I /dev/sda | grep 'Sector size'
hdparm -Tt /dev/sda | tee -a /var/tmp/hdparm.sda
#hdparm -Tt /dev/xvda | tee -a /var/tmp/hdparm.xvda
#hdparm -Tt /dev/xvda1 | tee -a /var/tmp/hdparm.xvda1

Clean local daemons' shutdown

cat /etc/rc.d/rc.local_shutdown
cat > /etc/rc.d/rc.local_shutdown <<-EOF
#!/bin/bash
#nothing here yet
EOF
chmod +x /etc/rc.d/rc.local_shutdown

The two rc.local scripts are executable by default

ll /etc/rc.d/rc.local /etc/rc.local
ll /etc/rc.d/rc.local_shutdown /etc/rc.local_shutdown

ln -s rc.d/rc.local /etc/rc.local
ln -s rc.d/rc.local_shutdown /etc/rc.local_shutdown

cd /etc/rc.d/
find . -executable -type f | less
chmod -x rc.wireless rc.bluetooth rc.fuse rc.inetd

Note. keeping rc.udev because without it, I get this error when trying to SSH,

PTY allocation request failed on channel 0

Eventually deploy your latest built kernel and update LILO

assuming some NFS mount point

cp -f /data/kernels/vmlinuz /
cp -f /data/kernels/config /
cp -f /data/kernels/System.map /
tar xzf /data/kernels/lib.modules.5.2.14.slackxenreiser4.tar.gz -C /lib/modules/
grep depmod /etc/rc.d/rc.modules
ll -lF /etc/rc.d/rc.modules

Eventually make linux fast again, whatever boot-loader you are using, and disable IPv6 at once

ll /etc/lilo.conf_example
mv -i /etc/lilo.conf /etc/lilo.conf.dist
sed -r '/^[[:space:]]*(#|$)/d' /etc/lilo.conf.dist > /etc/lilo.conf
vi /etc/lilo.conf

lba32

timeout = 30

image = /vmlinuz
  root = /dev/sda1
  label = Linux
  append = "vt.default_utf8=0 ipv6.disable=1 mitigations=off"
  read-only

lilo
shutdown -r now

and check after reboot

uname -r
cat /proc/cmdline

Virtual Terminals (for physical host, as those do not exist in a slackware guest. I find it convenient to see what happened lately on the console, and if you really want to hide it, just ^L before you ^D.

cd /etc
mv -i inittab inittab.dist
sed 's/agetty 38/agetty --noclear 38/' inittab.dist > inittab
diff -bu inittab.dist inittab

BSD Wannabe

KSH

vi /etc/profile

export ENV=/etc/shrc

further tune KSH and make it the default shell

chsh -s /bin/ksh root
useradd -D -s /bin/ksh

NVI

#/usr/sbin/slackpkg install db48 nvi
#ln -sf nvi /usr/bin/vi

Resources

slackware ยป beginners_guide https://docs.slackware.com/slackware:beginners_guide


Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml