Interview Prep/Linux/systemd services and journald

A unit fails with `status=226/NAMESPACE`.

AdvancedTroubleshootingsystemd services and journald
Answer

Likely causes → systemd couldn't set up the mount namespace for sandboxing options: a path in ReadWritePaths=, ReadOnlyPaths=, BindPaths= or InaccessiblePaths= doesn't exist, or the kernel/container doesn't allow namespaces.

Diagnose →

journalctl -u myapp -b | grep -i namespace
systemctl cat myapp | grep -E 'Paths=|Protect|Private'

Fix → Create the missing paths or prefix them with - to ignore missing ones (ReadWritePaths=-/var/lib/myapp). Inside unprivileged containers, drop the sandboxing options that need namespaces.

Prevent → Use StateDirectory=/LogsDirectory= so paths exist before the namespace is built.

All Linux questions Roadmap: Linux

More on systemd services and journald