systemd vs SysV init
PID 1 is the first userspace process and the ancestor of everything else on your system. For decades it was a simple program called init. Today most Linux distributions use systemd, which works very differently. Here's why it changed and how it works.
SysV init — Sequential Shell Scripts
Traditional SysV init worked simply: it read /etc/inittab, determined the runlevel, and executed shell scripts in /etc/rcX.d/ one by one.
Problems with SysV init:
- Sequential = slow. Each service waits for the previous to finish.
- Shell scripts are fragile and hard to get right.
- No standard way to check service status, restart on failure, or limit resources.
- Logs scattered across /var/log/ in different formats.
systemd — Parallel Dependency Graph
Other key systemd features:
- Socket activation: systemd creates network sockets on behalf of services, activating them only when a connection arrives. Faster boot, lazy start.
- cgroup integration: Every service gets its own cgroup — clean process accounting, no orphaned processes.
- Declarative unit files: Replace shell scripts with structured configuration.
- Unified logging: journald collects all logs in one searchable binary format.
- Automatic restarts:
Restart=on-failurein unit file.
Side-by-Side Comparison
| SysV init | systemd | |
|---|---|---|
| Startup model | Sequential | Parallel dependency graph |
| Config format | Shell scripts | Declarative .ini-style unit files |
| Service status | Fragile (exit codes) | Structured (systemctl status) |
| Logging | Scattered text files | Unified journald binary log |
| Resource limits | Manual (ulimit in scripts) | Built-in via cgroups |
| Boot speed | Slow (serial) | Fast (parallel) |
Essential systemctl Commands
Frequently Asked Questions
What will I learn here?
This page covers the core concepts and techniques you need to understand the topic and progress confidently to the next lesson.
How should I use this page?
Start with the overview, then follow the section links to deepen your understanding. Use the table of contents on the right to jump to specific sections.
What should I read next?
Use the navigation below to continue to the next lesson or explore related topics.