systemd and its use cases.
systemd is a system and service manager for your Linux based OS
it is responsible of managing multiple services as daemons in parallel which init was not capable of.
- Why not init?
init was capable of managing multiple services serially, this means that only after a certain task startup is completed (successful) the init would load a new service into RAM.
- Why systemd?
systemd was designed to overcome the disadvantages we had with init. by starting services in parallel the boot time is reduced.
note: a service may have multiple processes.
1. Features of systemd
- neat boot process with reduced time
- event logging with a daemon named journald
- low memory footprints
- systemd state can be preserved to be called later in future.
- Users login managed by systemd-logind.
and many more
2. Management of services by systemd
Basically to manage services it means we have to start, stop, enable and disable the services, to control/use the systemd we use systemctl command
For example: systemctl start <servicename>, systemctl stop <servicename>
systemctl enable <servicename> - this command creates a link of the service to the default target of the OS, so that the service will start whenever the OS is rebooted. similarly disable unlinks the service.
the default target of the OS can be found out by - systemctl get-default
you can also set the default target of the system from one to another.
ex: systemctl set-default multi-user
3. systemd units:
systemd introduces the concept of systemd units and there are several types, which are service unit, mount unit, automount unit, socket unit, slice unit, timer unit, path unit, scope unit, snapshot unit, swap unit, target unit, device unit. Units are defined in unit configuration files, which include information about the unit type and its behavior.
these files can be found at - /usr/lib/systemd/system
Some examples: use systemctl --help
List all mount units
- target units:
- failed units:
- list all units
4. Runlevels
files for runlevels can also be found in the same dir i.e /usr/lib/systemd/system
runlevels can be described in brief as follows
I would like to thank Ashutosh S. Bhakre Sir, for taking this session on systemd
THANK YOU