Mastodon Skip to content

systemd

The systemd module streamlines the management of systemd units during image building. Units are divided into system and user categories, with system units managed directly using systemctl and user units using systemctl --global. You can specify which units to enable/disable or unmask/mask under each category.

You can also include your systemd units to be copied into system directories into these locations,
depending if your unit is system or user based:
config/systemd/system
config/systemd/user

Those units are then copied into these folders (depending on unit base):
/usr/lib/systemd/system
/usr/lib/systemd/user

Supported management operations are enabling, disabling, masking and unmasking.

Example configuration

type: systemd
system:
enabled:
- example.service # Enabled (runs on system boot)
disabled:
- example.target # Disabled (does not run on system boot, unless another unit strictly requires it)
masked:
- example.service # Masked (does not run on system boot, under any circumstances)
unmasked:
- example.service # Unmasked (runs on system boot, even if previously masked)
user:
enabled:
- example.timer # Enabled (runs for the users)
disabled:
- example.service # Disabled (does not run for the users, unless another unit strictly requires it)
masked:
- example.service # Masked (does not run for the users, under any circumstances)
unmasked:
- example.service # Unmasked (runs for the users, even if previously masked)

Configuration options

system: (optional object)

System unit configuration.

enabled: (optional array)

List of systemd units to enable. (runs on system boot)

disabled: (optional array)

List of systemd units to disable. (does not run on system boot, unless another unit strictly requires it)

masked: (optional array)

List of systemd units to mask. (does not run on system boot, under any circumstances)

unmasked: (optional array)

List of systemd units to unmask. (runs on system boot, even if previously masked)

user: (optional object)

User unit configuration (with —global to make changes for all users).

enabled: (optional array)

List of systemd units to enable. (runs for the users)

disabled: (optional array)

List of systemd units to disable. (does not run for the users, unless another unit strictly requires it)

masked: (optional array)

List of systemd units to mask. (does not run for the users, under any circumstances)

unmasked: (optional array)

List of systemd units to unmask. (runs for the users, even if previously masked)