Systemd service files in non-default directory
9,934
Actually the real service files are in /lib/systemd/system
. Symlinks to them are created in /etc/systemd/system
when the services are enabled.
If you want to put your service files somewhere else, go ahead, but when you want to enable the service, you must specify the full path to the real service file so that systemd can make the symlink to /etc/systemd/system
, eg:
sudo systemctl enable /path/to/my-service-file
Related videos on Youtube
Author by
Admin
Updated on September 18, 2022Comments
-
Admin over 1 year
The default directory of service files is:
etc/systemd/system
and while this works ok, I was wondering if it was possible to specify another directory where service files can be put. The reason I want this is because I'd like to keep the service files that belong to the software that I'm writing together.Do you know if this is possible?
-
Admin about 7 yearsIf this is for a package, the default directory is not
/etc/systemd/system
, but/lib/systemd/system
. That said, why not put all your service files somewhere and create links to/lib/systemd/system
?
-
-
John over 4 yearsIt's giving me Access denied even with sudo
-
John over 4 yearsNevermind, here's the solution superuser.com/questions/1125250/…
-
Zanna over 4 years@John thanks for investigating and providing that link!