systemd and its use cases.

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

No alt text provided for this image

you can also set the default target of the system from one to another.

ex: systemctl set-default multi-user

No alt text provided for this image

3. systemd units:

systemd introduces the concept of systemd units and there are several types, which are service unitmount unitautomount 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

No alt text provided for this image
  • target units:
No alt text provided for this image
  • failed units:
No alt text provided for this image
  • list all units
No alt text provided for this image

4. Runlevels

files for runlevels can also be found in the same dir i.e /usr/lib/systemd/system

No alt text provided for this image

runlevels can be described in brief as follows

No alt text provided for this image


I would like to thank Ashutosh S. Bhakre Sir, for taking this session on systemd

THANK YOU

要查看或添加评论,请登录

Sagar Dahat的更多文章

  • Harbor Registry

    Harbor Registry

    Harbor is an open source container registry that secures artifacts with role-based access controls and policies…

    2 条评论

社区洞察

其他会员也浏览了