Slackware HowTo

Manage services on Slackware with /etc/rc.d

Start, stop, enable at boot, and manage services with rc scripts.

Slackware traditionally uses shell scripts in /etc/rc.d/. In many cases a service is "enabled" simply by making the script executable.

1. Basic concept

2. List available scripts

ls -l /etc/rc.d/rc.*
ls -l /etc/rc.d | less

Common examples: rc.sshd, rc.httpd, rc.crond, rc.ntpd, rc.networkmanager.

3. Start, stop, restart a service

/etc/rc.d/rc.sshd start
/etc/rc.d/rc.sshd stop
/etc/rc.d/rc.sshd restart
/etc/rc.d/rc.sshd status   # if supported by the script
Not all rc scripts support the same arguments. If status is missing, check processes/ports manually.

4. Enable/disable at boot

Many services start only if the script is executable.

# Enable
chmod +x /etc/rc.d/rc.sshd

# Disable
chmod -x /etc/rc.d/rc.sshd

Check permissions:

ls -l /etc/rc.d/rc.sshd

5. Useful checks after changes

ps aux | grep sshd
ss -tulpen | grep ':22'
tail -n 50 /var/log/messages

6. Typical services to consider on a Slackware server

Fewer active services = lower resource usage and smaller attack surface.

7. Create a custom rc script (basic)

For custom software, create your own /etc/rc.d/rc.my-service with start/stop/restart.

#!/bin/sh
case "$1" in
  start)
    /usr/local/bin/my-service &
    ;;
  stop)
    pkill -f /usr/local/bin/my-service
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
    ;;
esac

Make the script executable:

chmod +x /etc/rc.d/rc.my-service

8. Common errors

Quick checklist

[ ] Required services identified
[ ] rc scripts tested with start/stop/restart
[ ] Boot enablement verified (chmod +x)
[ ] Listening ports checked
[ ] Logs checked after start

Back to the Linux HowTo section