Skip to content
Back to skills

Systemd Knowledge Patch

ASecurity

systemd

  • 25 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 5, 2026
developmentgodebuggingapi

Works with

  • cursor
  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill systemd-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Systemd Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Systemd Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-systemd-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-systemd-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: systemd-knowledge-patch
description: systemd
version: "262"
license: MIT
metadata:
  author: Nevaberry
---


# systemd Knowledge Patch

Load this skill when migrating systemd configurations, authoring units, building
boot or disk images, or integrating with systemd's service and management APIs.
Use the topic references for complete guidance and version-specific behavior.

## Reference index

| Reference | Topics |
| --- | --- |
| [Compatibility, Builds, and Administration](references/compatibility-build-and-administration.md) | System V migration, build requirements, configuration lookup, machine identity, first boot |
| [Units and Activation](references/units-and-activation.md) | Unit editing, transient commands, environment expansion, restarts, reloads, sockets, timers, mount dependencies |
| [Resource Control and Sandboxing](references/resource-control-and-sandboxing.md) | Cgroups, concurrency, OOM, scheduling, namespaces, managed directories, filesystem protection |
| [Network Configuration](references/networking.md) | Forwarding, NAT, VLANs, addressing, DHCP, interface names, routing, reloads, cellular links |
| [Resolution, Observability, and IPC](references/resolution-observability-and-ipc.md) | DNS, journal queries and storage, coredumps, Varlink, event loops, reports, time synchronization |
| [Boot, UKIs, and TPM Policy](references/boot-uki-and-tpm.md) | Boot discovery, UKI profiles and inspection, Secure Boot, PCR policies, NvPCRs, factory resets, kexec |
| [Credentials and Enrollment](references/credentials-and-enrollment.md) | Credential formats and providers, TPM sealing, null-key policy, cryptenroll, crypttab, PKCS#11, FIDO2 |
| [Containers and Virtual Machines](references/containers-and-virtual-machines.md) | Nspawn, vmspawn, namespace brokers, machine registration, guest accounts, SSH and vsock |
| [Images, Storage, and Extensions](references/images-storage-and-extensions.md) | Dissection, repart, integrity, Verity, OCI mount stacks, portable services, extensions, sysupdate |
| [Devices and Administrative Tools](references/devices-and-administration.md) | Udev rules and ownership, device names, tmpfiles, sysctl, console settings, CLI metadata |
| [Homed, Users, and Sessions](references/homed-users-and-sessions.md) | User records, PAM classes, home areas, recovery keys, capsules, run0, inhibitors, sleep, device access |

## Breaking changes and deprecations

### Native units and compatibility interfaces

Replace `init 3` and dependencies on `runlevel3.target` with native target operations
such as `systemctl isolate multi-user.target`. Migrate init scripts and `rc.local`
jobs to native unit files before upgrading to v260. The packaged `rc-local.service`
is gone. Build with `-Dcompat-sysv-interfaces=yes` to install the restored numbered
runlevel targets and the `legacy.conf` tmpfiles rules.

V258 removes `org.freedesktop.systemd1.StartAuxiliaryScope()`. Callers that still
offload workers through this method need to manage their lifetime through a separate unit.

### Boot configuration and build recipes

V258 removes support for the `SystemdOptions` EFI variable. Boot settings still
supplied through that variable must move to a supported configuration channel
before upgrading. Use system credentials or configuration extensions for new deployments.

Replace `-Dbuild-executor-shared=single` with `-Dsystemd-multicall-binary=true` and
recreate build directories configured with the old options. `-Dstandalone-binaries=`
now takes a comma-separated list of patterns selecting the `.standalone` binaries to install.

### Reload readiness and environment expansion

A `Type=notify-reload` service must catch or block its `ReloadSignal=` before
sending `READY=1`. The manager fails startup with a protocol error if the signal
still has its default handling.

`systemd-run --scope` now expands command-line environment references by default,
like transient services. Pass `--expand-environment=no` to preserve literal references.
`Exec*=` arguments can expand variables listed in `UnsetEnvironment=` before those
variables are removed from the child process environment. Check units that previously
relied on a whole-word `$VAR` reference disappearing.

### Tmpfiles purge and validation

`systemd-tmpfiles --purge` requires at least one named configuration file and only
acts on entries marked with `$`. For example, put
`d$ /var/lib/demo 0750 root root -` in `demo.conf` and preview with
`systemd-tmpfiles --dry-run --purge ./demo.conf`.

A non-empty argument field on a `tmpfiles.d` line type that does not consume it
now fails validation. Remove previously ignored argument values from shipped snippets.

### Network forwarding and bridge configuration

Replace `IPForward=` with `IPv4Forwarding=` and `IPv6Forwarding=`. Set them in
`networkd.conf` for global forwarding and in a `.network` file for a specific link.
`IPv6SendRA=` and `IPMasquerade=` now imply per-link forwarding, so enable the
required global settings explicitly when migrating a router.

Once a link has a valid `[BridgeVLAN]` setting in its `.network` file, networkd
removes VLAN IDs absent from that configuration. Include manually provisioned
VLANs that must survive reconfiguration.

### Device owners and mapped container users

Udev accepts non-system users and groups in `OWNER=` and `GROUP=` again, and
networkd accepts them in `User=` and `Group=` in TUN/TAP `.netdev` files.
Both log deprecation warnings for these assignments.

In `.nspawn` files, `PrivateUsers=pick` and `PrivateUsers=managed` now default to
`PrivateUsersOwnership=auto`. Set `PrivateUsersOwnership=chown` or
`PrivateUsersOwnership=off` explicitly to retain the previous respective behavior.

### Sessions and inhibitors

Logind tracks the leader through a pidfd and stops the session when that process
exits. Keeping the descriptor returned by `CreateSession()` open no longer extends
the session lifetime.

`block` inhibits the operation even when root or the lock holder requests it.
Use `--check-inhibitors=no` for an explicit privileged override, or take an inhibitor
with `systemd-inhibit --mode=block-weak COMMAND` when the older caller exemptions are needed.

### TPM enrollment and NvPCR initialization

New TPM enrollments made by `systemd-cryptenroll`, `systemd-repart`, and
`systemd-creds` default to an empty mask. Use a managed `systemd-pcrlock` policy
when enrollment must depend on PCR 7, so routine Secure Boot policy changes can
be handled without pinning one literal measurement.

Ship every `/usr/lib/nvpcr/*.nvpcr` definition in the UKI and build it with
`ukify --sign-initrd-pcrs` to embed a signed PCR policy for the `initrd` phase with
that policy reference. The initial extend must take place in the initrd, so runtime
lazy initialization can fail. Existing NvPCRs are upgraded automatically and their
old anchor secrets are removed.

### Journal storage and field queries

Journald now defaults to `Storage=persistent`. Set `Storage=auto` in `journald.conf`
or build with `-Djournal-storage-default=auto` to retain selection based on the
presence of `/var/log/journal`.

`journalctl -F FIELD` and `journalctl --field=FIELD` reject entry filters such as
unit, boot, time, cursor, or grep. Query the matching entries and extract the field
from those results when you need filtered values.

### Sysupdate command and API migration

Invoke `systemd-sysupdate` from `libexecdir`. Its periodic units are now
`systemd-sysupdate-update.service` and `.timer`, with aliases for the old names.
V263 is expected to remove the experimental `systemd-sysupdated` D-Bus API, and
v262 offers direct Varlink queries for features, components, targets, and newer versions.

## Common configuration and integration tasks

### Retry failed services with debugging or jitter

Set `Restart=on-failure` and `RestartMode=debug` in `[Service]` to retry failed
invocations with `DEBUG_INVOCATION=1` and a temporary `LogLevelMax=debug`.
`RestartRandomizedDelaySec=` adds a uniformly distributed delay on top of
`RestartSec=` and any exponential backoff. Spread retries over 5 to 20 seconds:

```ini
[Service]
Restart=on-failure
RestartSec=5s
RestartRandomizedDelaySec=15s
```

### Bound concurrent activation

Set `ConcurrencySoftMax=` to keep excess start jobs queued until space opens and
`ConcurrencyHardMax=` to fail jobs above the hard limit. In a slice's `[Slice]`
section, `ActivatingConcurrencyMax=4` permits four units in its hierarchy to be
activating at once. Queued activations start automatically as slots become free.

### Reload credentials and extensions

Set `RefreshOnReload=yes` in `[Service]` to refresh extensions and credentials
when the service is reloaded. Set `ExecReloadPost=/usr/bin/logger reload-complete`
in `[Service]` to run a command once the service's configuration reload has completed.

### Supply encrypted credentials to users

Use `systemd-creds encrypt --user input.txt secret.cred` to prepare a user-scoped
credential. The `--uid=` option targets a specific user. User services can load
encrypted service credentials, including TPM-backed credentials.

With `systemd-creds encrypt --with-key=auto`, TPM2 sealing failure alone no longer
prevents encryption. Select an explicit TPM2 key mode when sealing to the TPM is required.

### Reload network definitions without reconfiguring links

Run `networkctl reload --no-reconfigure` to read `.network` and `.netdev` files
without reconfiguring links. This requires networkd's new
`io.systemd.Network.Reload()` Varlink method, which accepts `{"reconfigureLinks": false}`.

### Query a service invocation and drain a journal follower

Use `journalctl -u demo.service -I` for the latest invocation of `demo.service`.
Pass an invocation ID to `--invocation=` to select a specific run.
Run `journalctl --follow --synchronize-on-exit=yes` to print entries submitted
before Ctrl-C before exiting. Follow mode exits successfully on SIGINT, SIGTERM,
and a disconnected output pipe.

### Use OCI mount stacks and encrypted Verity images

An MStack describes an OverlayFS and bind-mount layout in a `.mstack/` directory.
`importctl pull-oci` stores an OCI image as an MStack, which can be used via
`RootMStack=/srv/example.mstack` in a unit's `[Service]` section or
`systemd-nspawn --mstack=/srv/example.mstack`.

Set both `Encrypt=` and `Verity=data` for the same data partition. Repart builds
dm-verity over the LUKS2 ciphertext, and systemd-dissect can open images with that layering.

### Manage writable extensions and refreshes

`systemd-sysext` can store a writable overlay upper directory under
`/var/lib/extensions.mutable/`. Use `--mutable=ephemeral` for a tmpfs upper layer
that is discarded when extensions are reattached.
`systemd-sysext refresh` and `systemd-confext refresh` skip remounting when images
have not changed. Pass `--always-refresh=yes` to force the unmount and mount.

### Keep the terminal available during activation

Use `systemd-run --pty-late` to start forwarding the terminal after the unit
activates, leaving it available for password prompts during activation.
Interactive `run0` uses this mode by default.

### Verify sysctl settings

Use `systemd-sysctl --verify --strict` on targeted settings to treat a failed or
mismatched read-back as an error. Verification is off by default because the kernel
can normalize values.

Files in this skill

  • SKILL.md10 KB
  • coverage.json808 B
  • references/boot-uki-and-tpm.md4.7 KB
  • references/compatibility-build-and-administration.md5.9 KB
  • references/containers-and-virtual-machines.md5 KB
  • references/credentials-and-enrollment.md2.9 KB
  • references/devices-and-administration.md4.8 KB
  • references/homed-users-and-sessions.md4.5 KB
  • references/images-storage-and-extensions.md5.4 KB
  • references/networking.md3.2 KB
  • references/resolution-observability-and-ipc.md4.6 KB
  • references/resource-control-and-sandboxing.md3.5 KB
  • references/units-and-activation.md4.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.