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

  1. Check if your system uses systemd: ps -p 1 -o comm=
  2. Start a service with systemd: sudo systemctl start nginx
  3. Enable a service at boot: sudo systemctl enable nginx
  4. Check status: sudo systemctl status nginx
  5. View logs: sudo journalctl -u nginx

Tips