Systemd initializes the Linux system - processes, mount,.. -, after the boot process has finished.
It also the first process that starts with a PID=1.

Systemd manages the system as units and unit files.

The systemd units control services, mounts, swap spaces, sockets, ...

A unit file is a file that contains different parameters and data about the units - services, devices, mount points, ... -

Systemd also handles the targets - equivalent to runlevels -, which are a combination of units "working together" to produce a certain environment, for example the "multi-user.target" environment ,or the "graphical.target" environment.

To know the default target that our system is running, we could use the below command:


To switch to a different target, for example the "multi-user.target", we use the below command:


To list all the unit-files, we use the below command:


To list all the unit-files for the services, we use the below command:


To list all the services, we use:


To list the "running" services, we use the below command:


The type could also be : socket, mount, swap, target, ...

The services could also have the below states:
  • enabled : enabled services start automatically.
  • disabled : are not taken into account during boot time.
  • static : can't be enabled or disabled
  • masked : masked services can't be started.
Services live in "/usr/lib/systemd/system" or "/lib/systemd/system"
directories.

Disabled services will not start at boot time, and we would have to start them manually is need be.
We can disable a service using the below command:


Masked services can't be started. We could mask a service using he below command:


Unit files stored in the "/usr/lib/systemd/system" directory, have the below format:


Brando Sabatini and Ikbal C ©. Powered by Blogger.