where to install systemd unit files

20 views
Skip to first unread message

Michael Ströder

unread,
Nov 10, 2016, 1:38:56 PM11/10/16
to ansible...@googlegroups.com
HI!

Is there any fact or similar pointing to the directory where to install systemd
unit files on different Linux distros?

Output of systemd-path is not helpful for this.

Currently I have in a custom map:
Debian: "/lib/systemd/system" (sigh!)
openSUSE: "/usr/lib/systemd/system"
CentOS: "/usr/lib/systemd/system"

But that's not very elegant.

Ciao, Michael.

Kai Stian Olstad

unread,
Nov 10, 2016, 3:57:35 PM11/10/16
to ansible...@googlegroups.com
On 10. nov. 2016 18:41, Michael Ströder wrote:
> Is there any fact or similar pointing to the directory where to install systemd
> unit files on different Linux distros?
>
> Output of systemd-path is not helpful for this.
>
> Currently I have in a custom map:
> Debian: "/lib/systemd/system" (sigh!)
> openSUSE: "/usr/lib/systemd/system"
> CentOS: "/usr/lib/systemd/system"

Every one of them and a lot of others distros, if not all, support
/etc/systemd/system, is there a reason for not using that directory?

--
Kai Stian Olstad

Michael Ströder

unread,
Nov 10, 2016, 4:26:37 PM11/10/16
to ansible...@googlegroups.com
Is a local "systemctl enable/disable" still possible when adding the unit files
directly to /etc/systemd/system? I thought this is done by adding/removing
symbolic links.

Ciao, Michael.


Kai Stian Olstad

unread,
Nov 10, 2016, 5:06:23 PM11/10/16
to ansible...@googlegroups.com
A link is created in /etc/systemd/system/*.target.wants to the service
file in /etc/systemd/system/ when enable is executed, and the link is
removed with disable, so yes it's still possible.

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages