Linux 101 : Systemd components overview
Systemd also allows us to start different processes simultaneously, resulting in a faster boot time.
- Systemd manages units
- Units have different types : socket, service, target,....
- Unit files contain the configuration of the different units.
Systemd units:
Systemd manages units and the different units represent the system resources that systemd manages. To see all the units in a system, we use:
Systemd unit files:
Unit files are configurations files that determines how systemd deals with the units (services, sockets, targets,....).
To list the unit files (configuration files), we use the below command:
To list the unit files (configuration files), we use the below command:
We could also see the configuration files by going to "/usr/lib/systemd/system", and displaying its content with the command "ls".
Remark:
Looking inside the configuration files:
To see the content of a configuration file, we use for the ssh service for example:
Unit types:
We have different unit types, to see all the types, we use:
Systemd targets:
Targets represent different "states" of the system, where only a group of resources are available (services, sockets, other targets,...).
To get the default target "state" we use:
We can list a specific service using the grep command:
To go into a command line - multi-user "state" we use:
To set the "multi-user.target" as the default state at boot time, we use:
We can list the dependencies of a target that are required for it to work properly, using the below command. In this example, we show the dependencies of the "graphical.target" target:
Service dependencies:
To list "sshd" service dependencies for example, we use:
Rebooting and powering off a system:
To power off a system, we use the below command:
To reboot the system, we use the below command:
Comments