Friday 6 March 2015

SystemD vs init

What is Init ?

In Linux, Init is used as a short form for Initialization. In Linux, init is the first process started during the booting of the computer system and continue running until it is shutdown. It is the parent process of all running processes directly or indirectly and automatically adopts all orphaned processes. Because it is the first process to start as the system boots up it is assigned PID 1 (process identifier).
If somehow init process unable to start, no process will be able to start and the system will reach a stage known as "Kernel Panic". Init is commonly known as System V init.

Several alternatives of init were developed from time to time few of which are:
Upstart
Epoch
Mudar
Systemd


What is Systemd ?

Systemd is a system management daemon, described by its author as a "basic building block" for an operating system primarily acts as a replacement of init. Systemd is not just the name of the init daemon but can also refer to the entire software bundle around itself, which includes the daemons systemd, journald, logind and networkd, and many other low-level components such as libraries and utilities. Like the init daemon, systemd is a daemon that manages other daemons, which, including systemd itself and works as a background process. Systemd is the first daemon to start during booting and the last daemon to terminate during shutdown. By offering on-demand service start-up and better transactional dependency controls, systemd dramatically reduces start up times. As a systemd user, you can prioritize critical services over less important services.




Some characteristics of Systemd :


  • From the moment that the initial RAM disk is mounted to start the Linux kernel to final shutdown of the system, all log messages are stored by the new systemd journal. Before the systemd journal existed, initial boot messages were lost, requiring that you try to watch the screen as messages scrolled by to debug boot problems.
  • Concurrent and parallel processing at boot.
  • Better integration with GNOME.
  • Services don't just have to be always running or not running based on runlevel, as they were previous to systemd. Services can now be activated based on path, socket, bus, timer, or hardware activation. Likewise, because systemd can set up sockets, if a process handling communications goes away, the process that starts up in its place can pick up the next message from the socket.
  • Tracks process using kernel's cgroup not PID.
  • Do more than just managing service, Systemd can manage several different unit files. It includes creation and use of devices, mount and automount filesystem, divide up computer resources, take snapshots of the current state of the system, set up sockets to allow communication, create and use swap partitions, trigger action based on time intervals.
  • Each systemd unit is always associated with its own cgroup lets you control the amount of resources each service can use. For example, you can set a percent of CPU usage by service which can put a jack on the total amount of CPU that service can use.



No comments:

Post a Comment