systemd user instances
Next to the system-wide instance of systemd, a separate user instance is also started for every user who logs in to the system.
This per-user instance allows people to define and run their own units with largely the same features as system-wide units, taking into account the following caveats:
- The user session of systemd is automatically started when the user logs in for the first time. This instance will run as long as there is some session for that user, and will be stopped as soon as the last session for the user is closed. 1
- User sessions run with the same permissions as the user they belong to. This means you obviously cannot run units as a different user.
- Resource control options may be limited.
Unit search paths
User instances of systemd look for unit files in the following locations:
/usr/lib/systemd/user/
~/.local/share/systemd/user/
/etc/systemd/user/
~/.config/systemd/user/
Controlling user instances
Both the systemctl and journalctl commands accept a --user
flag to operate on the user instance instead of on the system instance.
-
This behavior can be changed by enabling “lingering”. When linger is enabled for a given user, their systemd user instance is automatically started on boot and kept running even when there are no sessions for that user. Lingering can be enabled for a user with
loginctl enable-linger USERNAME
↩︎