Inhaltsverzeichnis

Slackware Installation and Configuration Tips

Abstract

Purpose of the document is the descpiption of ever repeating install and config procedures at a central place.

Because Slackware Linux uses most packages in their pristine forms, the documentation here is targeted mainly to this distro. The order of this document is more or less followning the natural installation order of a Slackware Linux system.

Examples of sourcefiles in this doc should specify their path (eg /etc/rc.d/rc.local) as a comment at the beginning.

Metadata

Third-party Programs

For additional Software first look in the extra directory of a Slackware mirror. Use the installpkg command to install one of those packages.

Second check out www.linuxpackages.net or www.slacky.eu (Also installed with installpkg). FIXME Are http://slackware.com/~alien/ and http://slackware.com/~rworkman/ worth a look too?

Third look at www.SlackBuilds.org. The SlackBuild Usage HOWTO tells you more.

If you can get 'only' the source code of a programm, than you should prefer checkinstall to the normal ./configure - make - make install procedure. Thus the software can be cleanly removed later or distributed ot oter Slackware-Boxes.

Self-build or third-party programs where no slackware package is available go to /usr/local/<programname-version>. Then make a symlink <programname> → <programname-version>. See also: Linux Filesystem Hierarchy, Linux Filesystem Hierarchy (german)

Another Tip: The compressed file MANIFEST.bz2 on the distro contains a list of all files wich all packages contain and install to the system. Example

Upgrading and Keeping Slack up to date

See Slackware Upgrade Mini-Howto

Linux Application Installation and Configuration Tips

See Slackware Application Installation and Configuration Tips

Slack Installation

Original Slack installation howto

As of Slack 12.0 making boot disks is obsoletete. The description is kept in Slack Tips - Attic for reference

Boot

UEFI systems might need some tweaking to boot: Slackware on an UEFI boot system

Since Slack 12.0 the default Kernel to select is hugesmp.s (hugse.s on 14.2 64Bit)

Select kernel: Since Slack 10.2 I prefer bareacpi.i over the default bare.i for standard IDE Systems. For my SCSI-PC I use adaptec.s. lspci -v will help to select the suitable kernel. (obsolete)

With bare.i & adaptec.s I always enable APM in /etc/rc.d/rc.modules by uncommenting the line /sbin/modprobe apm (later). This switches the system off completly after shutdown (Fans are turned off too). lsmod shows if APM is working. With bareacpi.i APM in not necessary. (obsolete)

Keyboard layout: quertz/de-latin1-nodeadkeys.map

For netword based setup, after login as root, type network!

Partitioning

Use cfdisk. Make at least 3 Partitions for Swap, / and /home.

Swap

If you have plenty of RAM than Swap is not so important, but create a Swap partition anyway, probabliy with the same size as the RAM. Otherwise a fstab may not be created.

Further reading: How big should my swap space be? See All about Linux swap space

/

This is where the packages of the distribution go. E.g. a full install of Slack 13.37 needs about 6.5 GB, so 8-9 GB is a good size for this partition

/home

Is for all data which has to survive a Slackware update. Use the rest of available disk space for this partition.

See Slackware Upgrade Mini-Howto how to use this partion also for e.g. /usr/local

Setup

Tips

Note: [Alt][Fx] gives another console while setup is running. Good for testing puposes

If you want to reuse old partitions which contain already data, eg for /home /home/share you can specify them here, but don't select to format them!

A note on network boot: It worked with the single line /mnt/cdrom/slackware *(ro,sync) in /etc/exports on the server and at the promt „What is the Slackware source directory“ /mnt/cdrom/slackware. Of course, the install DVD/CD has to be mountet in the cd-drive of the server before

Package Series Selection Recommendations: If disc space is sparse deselect E (Emacs), F (FAQ's), K (Kernel Source), T (TeX typesetting language), TCL (Tcl/Tk/TclX scripting languages and tools) & Y (Classic text-based BSD games). But select KDEI (KDE i18n – why??) (and remove unnecessary languages later)

:!: In order to track all local configuration changes, when the setup program asks to configure the network, switch to another console and make a cp of /mnt/etc

Setup Example

Install Linux Kernel: From CDROM! (Dont't skip)

Note on netconfig

If you use netconfig to setup a static IP connection it changes the following files:

/etc/resolv.conf
/etc/rc.d/rc.inet1.conf
/etc/HOSTNAME
/etc/hosts
/etc/networks

After Install Config

Bevore changing confiuration files, it is recommendable to keep a copy of the original file with the extension .org. Eg: cp /etc/ntp.conf /etc/ntp.conf.org. This allows to go back to the original configuration in case of failure and makes it easier to introduce your local changes to the new config files after an operation system upgrade (by using Upgrading Configuration Files with a three-way File Merge).

Sometimes there is already an identical copy of the config file supplied. Eg. in /etc/apache/ the files httpd.conf & httpd.conf.default are initially the same. In this case just make a symlink: httpd.conf.org → httpd.conf.default. Thus a find -name '*.org' will always give you an overview of modified config files.

(auto)mount & /etc/fstab

Users and Groups

On Slack userer can be added to the system with the adduser command. Make sure that local users are added to the groups audio, video, cdrom, plugdev. (adduser provides an option to preselect the most common groups.)
This avoids access right problems with various multimedia apps like Xine, Vlc or Skype.

CDROM & Floppy

FIXME Check: For command line (un)mounting the things below (pre Slack 12.0) still apply, i.e. you still need entries for cdrom and dvd devices:

:!: Since Slack 11.0 the cdrom-burner (kernel scsi-emulation in lilo) is not found in eg /dev/hdd anymore, but in eg /dev/sr0 ⇒ This means that a Symlink /dev/cdrom → /dev/sr0 and not /dev/cdrom → /dev/hdd. You get that hint when you try to mount eg # mount -t iso9660 /dev/cdrom /mnt/cdrom/ as root.

USB Drives

Since Slack 12 which uses HAL USB drives can mounted automatically if you stick to KDE, GNOME, or Xfce. They provide an automount feature via DBUS/HAL. Just add the usernames of the users to the plugdev group in /etc/group, reload configuration with /etc/rc.d/rc.messagebus reload and restart KDE. No changes to fstab are necessary.

If you also want to mount in the traditional way with the command line, than add a line for USB drives to /etc/fstab, eg: /dev/sda1 /media/memory0 auto users,noatime,async 0 0. The entries in fstab are respected by HAL. 'users' means that every user can mount and also a different user can unmount. 'noatime,async' are for conserving flasch memory lifetime. See slackware-12.0/CHANGES_AND_HINTS.TXT and linuxquestions.org

fstab Example

/dev/hda1        swap             swap        defaults         0   0
/dev/hda2        /                ext3        defaults         1   1
/dev/hda3        /home            ext3        defaults         1   2
/dev/cdrom       /mnt/cdrom       auto        noauto,users,ro  0   0
/dev/dvd         /mnt/dvd         auto        noauto,users,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,users     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
/dev/sda1        /media/memory    auto        users,noatime,async 0   0

/etc/profile.d/lang.sh

export LANG=de_DE.utf8
#export LANG=de_DE@euro #obsolete

This localizes many apps, eg Fluxbox Java, editors and pagers.

Note that for viewing and editing text files in a termial emulator window, both the emulator and the viewer/editor need to be UTF-8 aware.

Examples for applications which respect UTF-8 are the terminal emulator terminal (from the Xfce project), the pager less and the edior vim.

Dies beeinflußt auch das default character encoding von kate und kwrite unter Kde. Wählt man zB LANG=de_DE@euro, so ist das default encoding ISO-8859-15

locale -a shows all possible LANG values

/etc/profile.d/local.sh

#!/bin/sh
# default settings for every day command line usage
# may be overwritten in /home/<username>/.profile
 
# for CVS:
export EDITOR='/usr/bin/vim'
 
# for crontab -e
export VISUAL="$EDITOR"
 
# for mysql and man
#export PAGER='/usr/bin/most'
export PAGER='/usr/bin/less -iR'
# -i: case insesitive search; -R: colorize output (for colordiff)
 
# conveninence shortcuts:
alias   o="$PAGER"   # default pager
alias  oo=/usr/bin/view
alias   e="$EDITOR"  # default command line editor
alias  ge='kate -u'  # default gui editor
alias  vt='ls -hltrF'# directory listing time sorted newest last
alias  ll='ls -alF'  # detailed directory listing
alias  ..='cd ..'    # go to parent directory
alias ...='cd ../..' # go to parent of parent directory
alias cal='cal -3m'  # calendar: Start on Monday & display 3 Months
alias  bc='bc -l'    # calculator: preload mathlib, scale=20

~/.profile

Optional conveniences, dependent of the individual users taste go to $HOME/.profile. Here an example:

#!/bin/bash
# shebang only necessary for text coloring in editor
 
# use jedit instead of kate as gui editor:
# overwrites /etc/profile.d/local.sh
# only if jedit is installed & favored
alias ge='jedit'
 
# For per user scripts and commands:
# export is not really necessary here, because PATH is already exported in
# /etc/profile
export PATH=$PATH:~/bin
 
# Subversion log:
alias hglog='hg glog | o -S'

xorg.conf

No config necessary any more. (Otherwise see xorg_tips->etc_x11_xorg.conf)

Alsa/Pulse Sound

see Basic setup and as of 14.2 set mplayer to use pulse as output device

Harddisk Standby

Disable – MARK – timestamp appearing in a 20 minute interval in /var/log/messages. From Battery powered Howto & alt.os.linux.slackware Faq

#/etc/rc.d/rc.syslog :
...
#/usr/sbin/syslogd
/usr/sbin/syslogd -m 0
...

FIXME Check with kernel 2.6: Harddisk standby after a timeout of eg 20 min in /etc/rc.d/rc.local:

hdparm -S 240 /dev/hda

Values from 1 - 240 specify multiples of 5s. From man hdparm & Battery powered Howto and. Operation may not supported on SCSI disks. Doesn't seem to work with SCSI drives (eg. /dev/sda)

ACPI

FIXME As of Slack 12.2 this section seems to have become obsolete and needless.

To get battery control on laptops (eg in KDE) on Slack12 add this to /etc/rc.d/rc.modules :

/sbin/modprobe ac
/sbin/modprobe button
/sbin/modprobe battery
/sbin/modprobe processor
/sbin/modprobe thermal
/sbin/modprobe fan
/sbin/modprobe video
/sbin/modprobe container

Source, description, more

Create and install an Initrd

See Use Generic Kernel with an Initrd

Remote Login

For remote Login via window manager see xorg_tips->kdm

To start remote xapps via ssh enable X11Forwarding on the (application-)server side by uncommenting it somewhere in /etc/ssh/sshd_config:

#X11Forwarding no
X11Forwarding yes

Additionaly log into the server with ssh -Y.

Terminal Emulator Config Example

As of 2009-05-05 terminal emulator of the Xfce window manger (called „Terminal“, alternatively started with terminal) is recommended. It supports multiple tabs, transparency and respects UTF-8.

For a start here is a resonable configuration file for terminal. Copy it to : $HOME/.config/Terminal/terminalrc:

[Configuration]
BackgroundMode=TERMINAL_BACKGROUND_TRANSPARENT
CommandLoginShell=TRUE
FontAntiAlias=FALSE
FontName=Fixed 12
MiscDefaultGeometry=80x62
MiscMenubarDefault=FALSE
MiscConfirmClose=FALSE

Obsolete settings for mrxvt, aterm and xterm are at Slack Tips - Attic.

Remove unnecessary Language Packages

Rename the language packages you need in /var/log/packages and run removepkg …. Then re-rename the necessary packages to their original name again. Example for keeping only German (and default Enlish) :

cd /var/log/packages
mv kde-i18n-de-3.5.4-noarch-1 _kde-i18n-de-3.5.4-noarch-1
mv koffice-l10n-de-1.5.2-noarch-1 _koffice-l10n-de-1.5.2-noarch-1
removepkg kde-i18n-* koffice-l10n-*
mv _kde-i18n-de-3.5.4-noarch-1 kde-i18n-de-3.5.4-noarch-1
mv _koffice-l10n-de-1.5.2-noarch-1 koffice-l10n-de-1.5.2-noarch-1

Alternatively deselect the KDEI package series during setup and install the necessary language packages later manually with installpkg from the CD.

Internet Connection and Networking

For Internet Connection wired or WLAN, with DSL router, with DSL modem or with analog modem and for Firewall setup see Linux Networking Tips

Printing

Local Printer Setup

Use Cups as Printing System

Check if cupsd is running with ps aux | grep cups or point browser to http://localhost:631 . If cupsd is not running, make rc.cups executable and start cupsd with /etc/rc.d/rc.cups start

On http://localhost:631 and your root password you can add local connected printers. Note that as of Slack12 an USB printer has to be connected (and switched on) in order to be selectable.

Optionally install Turboprint

To setup Turboprint download the latest 1.x version from http://turboprint.de (keyfile-readmy claims to work only with 1.x versions of tp) & unpack. Dont change system.cfg (using /usr/local instead of /usr won't work with cups!). Install as root with ./setup . This may last a long time. Output should be similar to

Program Files /usr/share/turboprint
Commands      /usr/bin
Spool Dir     /var/spool/lpd
Man Pages     /usr/share/man
Log Files     /var/log
Temp          /tmp
Cups Drivers  /usr/share/cups/model
Cups Filters  /usr/lib/cups/filter

To setup printers start (x)tpsetup as root. xtpsetup needs X, so start it with su -c $(which xtpsetup) or something like

xhost +
su root
export DISPLAY=:0.0

Click on 'add' to add a new printer. To setup an USB printer use /dev/usb/lp0 as output in xtpsetup

To register keyfile, save the keyfile somewhere, start xtpsetup as root, press register → install keyfile and select keyfile in dialog box.

Turboprint manual: online offline / Cups manuals: for admins for users

Useful commands

lpinfo -v
lpstat -p -d # ?
lpadmin -d printername # set default printer see cups admin manual

Open Questions

FIXME On ingolf at 2006-11-28 hat been problems with parallel port, cups said „Parallel port busy; will retry in 30 seconds…“ and the printer (S500) stopped working. Searching google brought: http://www.luga.at/mailing-lists/luga/2006/07/msg00039.html. So I uncommented the „# PC parallel port support #“ section in /etc/rc.d/rc.modules and set /sbin/modprobe parport_pc io=0x378 irq=7. Lets see, if it works from now on…

Network Printer Setup

On the client side (this is the host which wants to use the printer, but where the printer is not connected locally) just make sure, that cupsd is running. No more changes are necessary.

On the server side, where the printer is connected via USB or printer cable, first make a local printer setup (see above) Turboprint needs only to be installed on the server side.

Than edit /etc/cups/cups.conf:

#BrowseAddress @LOCAL
BrowseAddress @LOCAL
<Location>
  ...
  #Allow From 127.0.0.1
  Allow From @LOCAL
</Location>
<Location admin> :
  ...
  #Allow From 127.0.0.1
  Allow From @LOCAL
</Location> :

Die ersten beiden Änderungen bewirken das remote cupsd's die lokalen Drucker erkennen können. Wird die 1. Änderung wieder Rückgängig gemacht, so vergessen die Clients auch die Drucker auf ingolf wieder.

Die 3. Änderung bewirkt, daß die Administration auch von einem entferten Rechner erfolgen kann @LOCAL heißt nur das lokale Netz, keine Dial-up Broadcasts (siehe cupsd.conf)

Restart cupsd then!

Printer config Frontends

Note: This needs to be verified — 2006-11-07 14:50

Frontends

Rules

Open Questions

Network Time Protokol NTP

See Network Time Protokol NTP

Shutdown

Allow Shutdown for normal Users

FIXME Change sudo config or suid /sbin/halt and symlink /usr/local/bin/shutdown → /sbin/halt, /usr/local/bin/reboot → /sbin/halt

Automate Shutdown with cron

Get system crontab file as root: crontab -l > cronbuffer; Open cronbuffer with vim and add somesthing similar to the following lines:

...
# Run daily cron jobs not at 4:40 but at 18:00 every day:
0 18 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null
...
# Daily Shutdown Mo-Fr at 18:10, Sa&So at 17:00, give user 5 Minutes to log out:
0  17 * * 5-0  /sbin/shutdown -h +5 "Weekend! Shutting down!"
10 18 * * 1-4  /sbin/shutdown -h +5 "Quitting time! Shutting down!"

(At this occasion the time of daily jobs is also changed to something more reasonable at daytime, assuming your computer is off at night. This makes the command locate work properly.)

Install your new crontab with crontab cronbuffer. (Normally you could also use crontab -e to directly edit the crontab, but this did not work on Slack 11.0, don't know why.)

Backup with rsyncd

See beckibackup

NFS

Server Side

Quick & dirty

/etc/rc.d/rc.nfsd must be executable. (rc.inet2 starts rc.nfsd)

# file: /etc/exports
/home/becki/nfs  *(rw)

This allows any(*) client to mount the local dir /home/becki/nfs with read/write(rw) permission. NFS is an unauthenticated protocol.

User ID Mapping

Assume the same user on the client has user ID 1000, group ID 1000 and on the server user ID 1005, group ID 100 . With the settings in /etc/exports above, files created by the client on the server would have user ID 1000, groop ID 1000 1). Hence permissions on the server need to be given accordingly (chmod 777 /home/becki/nfs).

If you want the files created by the client on the server with the IDs of the server, the following exports file is necessary:

# file: /etc/exports
/home/becki/nfs  *(rw,all_squash,anonuid=1005,anongid=100)

Restrictions

/opt/ltsp  192.168.0.0/255.255.255.0(ro)

Restricts the dir /opt/ltsp to read only (ro) access to your localnet (which is 192.168.0.0-192.168.0.255 in the example).

/tftpboot  *.somedomain.de(rw)

Restricts /tftpboot to read/write (rw) access to all hosts belonging to somedomain.de.

Allow root Access

/opt/ltsp  willi(no_root_squash)

Root user from host „willi“ can act on the server as root too. Dangerous, dont' use it. From exports(5)

Client Side

mount -t nfs serverName:/home/becki/nfs /mnt/tmp

Fluxbox

Background Image

Call fbsetbg -r /home/becki/wallpapers for a random pic or fbsetbg -a /home/becki/wallpapers/aCertainImage.jpg once for only one maximized image. Both commands create ~/.fluxbox/lastwallpaper

Add session.screen0.rootCommand: fbsetbg -l to ~/.fluxbox/init to get the bg-image at startup of fluxbox. (more)

Alternatively, this crontab changes the background image every 10 minutes (-R ignores ~/fluxbox/lastwallpaper):

# MIN HOUR DAY MONTH DAYOFWEEK   COMMAND
*/10 * * * *  PATH=$PATH:/usr/X11/bin DISPLAY=:0.0 /usr/X11R6/bin/fbsetbg -R /home/becki/wallpapers &> /dev/null

FTP Server

Slack 11.0 provides vsftpd and proftpd as FTP servers. proftpd is uses because of oviously better documentation and apache-like config file.

If you want to restrict to restrict the ftp users to their home dir, add the line

DefaultRoot ~

to /etc/proftpd.conf. More config templates and docu can be found in /usr/doc/proftpd-1.3.0/.

MySql

see MySql Tips and Commands

Apache & PHP

See Apache Webserver Tips

Java Runtime

Since Slack14 Java is gone. ⇒ Download jdk-XXXX-linux-i586.tar.gz from java.sun.com (no rpm)

cd  /usr/local
tar -xf jdk-XXXX-linux-i586.tar.gz
rm jdk-XXXX-linux-i586.tar.gz
chown -R root:root jreXXX
ln -s jreXXX java
cd /etc/profile.d
curl -O http://download.dlackware.com/slackware/slackware/extra/java/profile.d/jre.sh
chmod +x jre.sh
--- jre.sh~	2009-04-29 19:29:03.000000000 +0200
+++ jre.sh	2012-08-19 14:41:41.712846717 +0200
@@ -1,4 +1,4 @@
 #!/bin/sh
-export JAVA_HOME=/usr/lib/java
+export JAVA_HOME=/usr/local/java
 export MANPATH="${MANPATH}:${JAVA_HOME}/man"
 export PATH="${PATH}:${JAVA_HOME}/bin"

Note: This jre.sh works for the JDK as well. It doesn't matter if you istall the JDK or just the JRE to /usr/local

Apache Ant

See the Ant page in the coding section

Groovy

See the Groovy page in the coding section

Apache Tomcat

See Apache Tomcat

Samba

See Samba Setup

Setup a Mailserver

For Postfix and Dovecot see Setup a Mailserver

Quota

See Quota

1)
man exports → User ID Mapping