What is the difference between systemd and init.d
· Category: Linux
Short answer
systemd is a modern system and service manager that replaces the traditional SysV init.d system. It offers parallel startup, dependency management, and centralized logging via journald, while init.d uses sequential shell scripts. To manage services with systemd, see how to use systemd. For writing custom service scripts, see how to write bash scripts.
Steps
- Check if your system uses systemd:
ps -p 1 -o comm= - Start a service with systemd:
sudo systemctl start nginx - Enable a service at boot:
sudo systemctl enable nginx - Check status:
sudo systemctl status nginx - View logs:
sudo journalctl -u nginx
Tips
- systemd uses unit files instead of init.d shell scripts
- For automating service checks, combine systemd with how to write bash scripts
- Secure remote management with how to configure SSH key-based login