I keep finding, while googling, that they're located at /usr/lib/systemd/system/ and /etc/systemd/system/. However, in my ubuntu, the first doesn't even exist, and the other has only a few services
bluetooth.target.wants default.target.wants hybrid-sleep.target.wants shutdown.target.wants
dbus-org.bluez.service display-manager.service multi-user.target.wants sockets.target.wants
dbus-org.freedesktop.Avahi.service display-manager.service.wants network-online.target.wants suspend.target.wants
dbus-org.freedesktop.ModemManager1.service getty.target.wants paths.target.wants sysinit.target.wants
dbus-org.freedesktop.nm-dispatcher.service graphical.target.wants plexmediaserver.service syslog.service
dbus-org.freedesktop.thermald.service hibernate.target.wants printer.target.wants timers.target.wants
Where are the others?
When I run systemctl list-units I see so many services but I don't know where to locate them. For example, where is my plexmediaserver.service? I need to know because that's where I want to put my other units.
Best Answer
The package-provided service files are all usually located in
/lib/systemd/system
. For example, search for.service
in the package index.From
man systemd.unit
:The latter ones are for user sessions. IIRC Ubuntu 16.04 still uses upstart for user sessions, so those files are only applicable from after 16.04.
For a specific service, to see what systemd is reading, run
systemctl status <service>
orsystemctl show <service>
: