How are services installed by the package manager (in /usr/lib/systemd/
) supposed to be used in Debian (9.5)?
I can see loads of services installed in /usr/lib/systemd/user
, but these are not available via the normal systemctl status my-service
command. Am I supposed to manually copy the services I want to use into /etc/systemd/user/
?
Systemd allows you to have a user-specific services for each user in addition to the system-wide services. Those can be managed by regular systemctl command (stop
, start
, status
, edit
, enable
, ...) if you add the --user
flag. If you have for example /usr/lib/systemd/user/syncthing.service
, the system-wide service manager doesn't know about it, but the one for users does:
↪ ls /usr/lib/systemd/user/syncthing.service
Permissions Size User Date Modified Name
.rw-r--r-- 285 root 13 Jun 20:40 /usr/lib/systemd/user/syncthing.service
↪ systemctl status syncthing
Unit syncthing.service could not be found.
↪ systemctl --user status syncthing
● syncthing.service - Syncthing - Open Source Continuous File Synchronization
Loaded: loaded (/usr/lib/systemd/user/syncthing.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-07-24 17:10:22 CEST; 2 weeks 3 days ago
Docs: man:syncthing(1)
Main PID: 815 (syncthing)
CGroup: /user.slice/user-1000.slice/[email protected]/syncthing.service
└─815 /usr/bin/syncthing -no-browser -no-restart -logflags=0
systemctl status --user
can be used to list all currently active units for the current user.
It's also possible for users to define their own units if they are unable to write to /usr/lib/systemd/user
or for the administrator to define user units local to the system, by adding them to one of the directories listed for this purpose in systemd.unit(5):
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments