SysVinit Vs Systemd Cheatsheet

systemd is a new init system and system manager which was implemented/adapted into all the major Linux distributions over the traditional SysV init systems.

systemd is compatible with SysV and LSB init scripts.

It can work as a drop-in replacement for sysvinit system.

systemd is the first process get started by kernel and holding PID 1.

It’s a parent process for everything and Fedora 15 is the first distribution which was adapted systemd instead of upstart.

systemctl is command line utility and primary tool to manage the systemd daemons/services such as (start, restart, stop, enable, disable, reload & status).

systemd uses .service files Instead of bash scripts (SysVinit uses). systemd sorts all daemons into their own Linux cgroups and you can see the system hierarchy by exploring /cgroup/systemd file.

Below three init systems are widely used in Linux.

  • System V (Sys V): System V (Sys V) is one of the first and traditional init system for Unix like operating system.
  • Upstart: Upstart is an event-based replacement for the /sbin/init daemon.
  • systemd: Systemd is a new init system and system manager which was implemented/adapted into all the major Linux distributions over the traditional SysV init systems.

What is System V (Sys V)?

System V (Sys V) is one of the first and traditional init system for Unix like operating system. init is the first process that started during the system boot up by the kernel and it’s a parent process for everything.

Most of the Linux distributions started using traditional init system called System V (Sys V) first. Over the years, several replacement init systems were released to address design limitations in the standard versions such as launchd, the Service Management Facility, systemd and Upstart.

But systemd has been adopted by several major Linux distributions over the traditional SysV init systems.

What is systemd?

systemd is a new init system and system manager which is become very popular and widely adapted new standard init system by most of Linux distributions. Systemctl is a systemd utility which is help us to manage systemd system.

Systemd Features

  • Systemd provides aggressive parallelization capabilities
  • Uses socket and D-Bus activation for starting services
  • Offers on-demand starting of daemons
  • Keeps track of processes using Linux cgroups
  • Supports snapshotting and restoring of the system state
  • Maintains mount and automount points
  • Implements an elaborate transactional dependency-based service control logic

DescriptionSysVinitSystemd
Start a Serviceservice example startsystemctl start example
Stop a Serviceservice example stopsystemctl stop example
Stop and then Start a Service (Restart a Service)service example restartsystemctl restart example
Reload a Service (Reload the config file)service example reloadsystemctl reload example
Restarts if the service is already runningservice example statussystemctl status example
Check whether a service is currently runningservice example condrestartsystemctl condrestart example
Enable the service in bootchkconfig example onsystemctl enable example
Disable the service in bootchkconfig example offsystemctl disable example
check whether a service is configured to start or not in bootchkconfig examplesystemctl is-enabled example
Print a list of services enabled or disabled on boot with runlevels infochkconfig --listsystemctl list-unit-files --type=service
Paint a particular service info with runlevlels on or offchkconfig example --listls /etc/systemd/system/*.wants/example.service
Create a new service file or modify any configurationchkconfig example --addsystemctl daemon-reload

Runlevels/targets : Systemd has a concept of targets which serve a similar purpose as runlevels but act a little different. Each target is named instead of numbered and is intended to serve a specific purpose.
DescriptionsSysVinitsystemd
Halt the system0, haltrunlevel0.target, poweroff.target, systemctl halt
Single user mode1, S, singlerunlevel1.target, rescue.target
Multi User2runlevel2.target, multi-user.target
Multi User with Network3runlevel3.target, multi-user.target
Experimental (No User)4runlevel4.target, multi-user.target
Multi-user With Graphical & Network5runlevel5.target, graphical.target
Reboot6, rebootrunlevel6.target, reboot.target, systemctl reboot
Emergency shell emergencyemergency.target

Prakash Subramanian

Prakash Subramanian is a Linux lover and has 3.5+ years of experience in linux server administration with major Linux distribution such as (RHEL, CentOS, Ubuntu). He is currently working as a Senior L2 Linux Server administrator.

You may also like...

Shares
Close
Please support the site
By clicking any of these buttons you help our site to get better