Systemd

Table of Contents

1. Cheat sheet

1.1. Reload the set of units after editing files

systemctl daemon-reload

1.2. List units

systemctl list-units

1.3. List unit files

systemctl list-unit-files

1.4. View a unit file's content

systemctl cat UNIT

1.5. Override a unit's attribute

This will create a UNIT.d/override.conf file (and directory). See Units can be overridden.

systemctl edit UNIT

2. Systemd Units

  • a unit is any resource that systemd knows how to manage
  • units are defined in unit files

2.1. Units can be overridden

  • either fully, by providing a unit file with the same name, but at a location that takes precedence
  • or partially, by creating a directory with the same name of the unit, with an extra suffix .d, and putting .conf files in that directory

2.2. Types of units

2.2.1. .automount

2.2.2. .device

2.2.3. .mount

2.2.4. .path

2.2.5. .scope

2.2.6. .service

2.2.7. .slice

2.2.8. .snapshot

2.2.9. .socket

2.2.10. .swap

2.2.11. .target

Targets are used as a synchronization mechanism between units.

2.2.12. .timer

3. Systemd Generators

  • generators are executable that are run before any service is started
  • generators are used mainly for backward compatibility (e.g. to process rc.local into a systemd unit).

4. Symbolic link farms

Systemd uses directories containing symlinks to store data about the units. For example there are *.wants/ and *.requires/ directories to denote dependency relationships between units.

5. Other resources

6. Backlinks

Created: 2024-04-06 Sat 00:49