[2025-jun-17] The SlackDocs Wiki has moved to a new server, in order to make it more performant.
Table of Contents
Slackware Init System and Boot Process
Overview
In the age of systemd, many Linux users have never seen a real init script. They know systemctl and journalctl, but have no clear picture of what actually happens when the kernel hands control over to userspace.
Slackware, one of the oldest living Linux distributions, still uses a traditional init system. The entire boot process is readable in an afternoon.
If something breaks, you can reason about it because it is just shell scripts running top to bottom. If you want something to happen at boot, you put it in a file and make it executable.
This document walks through the Slackware boot process from the moment the kernel starts to the moment you see a login prompt. Scripts covered here are from Slackware -current.
Manual page references appear like this: init(8), where the number in parentheses is the manual section. Read them with:
$ man 8 init
Boot flow
kernel -> /sbin/init -> /etc/inittab -> rc.S -> rc.M -> login
|
rc.0 / rc.6 (halt/reboot)
systemd vs sysvinit — cheat sheet
For users coming from Ubuntu or Fedora, this table maps familiar concepts to their Slackware equivalents.
| Concept | systemd (Ubuntu/Fedora) | Slackware (sysvinit) |
|---|---|---|
| The manager | systemd (large binary) | sysvinit (small C program) |
| Startup logic | dependency graph (parallel) | linear scripts (top-to-bottom) |
| Boot config | /etc/systemd/* units | /etc/inittab |
| Runlevels | targets | numeric (3=multiuser, 4=X11) |
| Enable a service | systemctl enable foo | chmod +x /etc/rc.d/rc.foo |
| Disable a service | systemctl disable foo | chmod -x /etc/rc.d/rc.foo |
| Check service state | systemctl status foo | ls -l /etc/rc.d/rc.foo |
| Custom boot tweaks | .service files | /etc/rc.d/rc.local |
| Logs | journalctl -xe | /var/log + syslog |
| Troubleshoot boot | systemd-analyze | read the script |
From kernel to userspace
Once the kernel has initialized memory management and attached drivers to hardware, it starts exactly one userspace process:
/sbin/init
Everything else descends from this single process.
init runs as PID 1. It must never die. If it crashes, the kernel panics. It is the ancestor of every process on the system.
On Slackware, /sbin/init is the sysvinit(8) binary — a small C program, not a shell script. The kernel requires a real executable as PID 1 because it must:
- read
/etc/inittabbefore any shell is available - manage runlevel transitions reliably
- respawn login processes
- catch kernel signals (e.g., Ctrl+Alt+Del)
- reap orphaned child processes
A shell script exits when it reaches the end. init never exits. That is why PID 1 must be a compiled program.
/etc/inittab
After starting, init(8) reads /etc/inittab(5). This file defines the entire system behavior.
Format:
id:runlevels:action:process
Default runlevel
id:3:initdefault:
Sets the default runlevel to 3 (multiuser mode).
Slackware runlevels:
0= halt1= single-user3= multiuser (default)4= graphical (X11/Wayland via display manager)6= reboot
initdefault to 0 or 6.
System initialization
si:S:sysinit:/etc/rc.d/rc.S
Runs once at boot, before entering any runlevel. rc.S performs low-level system initialization.
Multiuser startup
rc:2345:wait:/etc/rc.d/rc.M
For runlevels 2–5, rc.M is executed and init waits for it to finish. This brings the system to full multiuser state.
Ctrl+Alt+Del
ca::ctrlaltdel:/sbin/shutdown -t5 -r now
Handles Ctrl+Alt+Del cleanly.
Login prompts
c1:12345:respawn:/sbin/agetty --noclear 38400 tty1 linux
Keeps login prompts alive. When you log out, init respawns agetty.
Display manager
x1:4:respawn:/etc/rc.d/rc.4
In runlevel 4, starts the display manager and restarts it if needed.
That is the entire boot configuration — in one readable file.
/etc/rc.d/rc.S — system initialization
rc.S runs once, very early. At this point:
- root is read-only
/procand/sysare not mounted/devis mostly empty- no network exists
Mount virtual filesystems
/sbin/mount -v proc /proc -t proc /sbin/mount -v sysfs /sys -t sysfs
These expose kernel and hardware state to userspace.
Start device management
/etc/rc.d/rc.udev start
udev dynamically creates device nodes in /dev.
Check filesystem
/sbin/fsck $FORCEFSCK -C -a /
Fixes inconsistencies after crashes.
/etc/fastboot— skip check once/etc/forcefsck— force check
Remount root read-write
/sbin/mount -w -v -o remount /
Before this, nothing can write to disk.
Mount remaining local filesystems
/sbin/mount -a -t nonfs,nosmbfs,nocifs,noproc,nosysfs
Seed entropy
/usr/sbin/seedrng
Ensures secure randomness early in boot.
At this point, the system is stable enough to continue.
/etc/rc.d/rc.M — multiuser initialization
rc.M builds the full system.
Set hostname
/bin/hostname $(cat /etc/HOSTNAME)
Bring up networking
/etc/rc.d/rc.inet1 /etc/rc.d/rc.inet2
Start services
Services follow this pattern throughout rc.M:
if [ -x /etc/rc.d/rc.crond ]; then
/etc/rc.d/rc.crond start
fi
This applies to all services: syslog, NTP, SSH, cron, Apache, MariaDB, Samba, and others. Everything is optional and controlled the same way.
Custom boot logic
if [ -x /etc/rc.d/rc.local ]; then
/etc/rc.d/rc.local
fi
Place any custom startup commands here.
The executable bit as a service manager
There is no service database. There is only the filesystem.
- Enabled = executable
- Disabled = not executable
$ ls -l /etc/rc.d/
# chmod -x /etc/rc.d/rc.httpd # disable # chmod +x /etc/rc.d/rc.httpd # enable
A directory listing shows the entire system state at a glance.
Conclusion
Slackware's init system is not simple because it lacks features. It is simple because it solves the problem directly:
- run scripts
- keep processes alive
- shut down cleanly
The entire boot process lives in four files:
/etc/inittab /etc/rc.d/rc.S /etc/rc.d/rc.M /etc/rc.d/rc.local
Read them, and you understand your system. That kind of transparency has real value — especially when something breaks and you need to reason about what is actually happening.
References
init(8)manual pageinittab(5)manual pageagetty(8)manual pagefsck(8)manual pageudev(7)manual page
See also
Sources
* Originally written by r1w1s1