Init systems

Linux

Init, short for "initialization," is the first process the Linux kernel starts after booting. It is responsible for bringing the system to a usable state by starting system processes, running startup scripts, and managing runlevels. SysvInit, Systemd, and OpenRC are the different and most used init systems.
SysvInit is the traditional, older system that uses sequential scripts; Systemd is a more recent, comprehensive system that features parallel startup and a wide range of tools; and OpenRC is a lightweight, dependency-based alternative that can work with SysvInit or on its own. 

SysvInit

  • It was one of the first init systems widely adopted and was the standard for many years; it's a classic init system that uses sequential scripts located in /etc/rc.d/ to start services one after another. Distributions that use Sysvinit include Slackware, Gentoo, Alpine Linux, PCLinuxOS, and AntiX. Other distributions like MX Linux and Devuan also support Sysvinit, often as an option alongside other init systems like OpenRC.
  • Services are managed with commands like chkconfig and service.

Systemd

  • It has become the default init system for most modern Linux distributions, having replaced SysvInit and Upstart; it's a modern init system designed to be more robust and efficient than SysvInit, featuring parallel service startup and on-demand activation. It also includes a comprehensive suite of system management tools that sometimes led to criticism for its complexity.
  • Services are managed with the systemctl command

OpenRC

  • It was developed for Gentoo Linux and is still its default init system, but it is also used in some other systems like Alpine Linux and BSDs. It's a dependency-based init system that is a more advanced replacement for the sysv-rc script collection, written in C for better performance than its predecessors. OpenRC is known for being lightweight and efficient, making it popular with users who want a simpler alternative to Systemd, although some argue it is less capable at handling service failures than Systemd, which has more advanced retry strategies.
  • Services are managed using rc-service and rc-update for enabling/disabling services.

Services Commands

Task / System SysVInit systemd OpenRC
Start a service service <service> start systemctl start <service>.service rc-service <service> start
Stop a service service <service> stop systemctl stop <service>.service rc-service <service> stop
Restart a service service <service> restart systemctl restart <service>.service rc-service <service> restart
Reload a service service <service> reload systemctl reload <service>.service rc-service <service> reload
Service status service <service> status systemctl status <service>.service rc-service <service> status
Enable a service at boot chkconfig <service> on systemctl enable <service>.service rc-update add <service>
Disable a service at boot chkconfig <service> off systemctl disable <service>.service rc-update del <service>
Check if a service is enabled at boot chkconfig <service> systemctl is-enabled <service>.service rc-update -v | grep <service>


Miscellaneous system commands

Task / System SysVInit systemd OpenRC
Halt the system halt systemctl halt halt
Power off the system poweroff systemctl poweroff poweroff
Reboot the system reboot systemctl reboot reboot
Suspend the system pm-suspend systemctl suspend pm-suspend
Hibernate the system pm-hibernate systemctl hibernate pm-hibernate
Show system logs tail -f /var/log/messages or tail -f /var/log/syslog journalctl -f tail -f /var/log/messages

Previous Post Next Post