# where to install systemd unit files

**URL:** <https://forum.ansible.com/t/where-to-install-systemd-unit-files/23005>\
**Category:** Ansible Project\
**Created:** [November 10, 2016, 5:41pm UTC](https://forum.ansible.com/t/where-to-install-systemd-unit-files/23005 "2016-11-10T17:41:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [November 10, 2016, 5:41pm UTC](https://forum.ansible.com/t/where-to-install-systemd-unit-files/23005/1 "2016-11-10T17:41:06Z")

</div>

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:  
&nbsp;&nbsp;Debian: "/lib/systemd/system" (sigh!)  
&nbsp;&nbsp;openSUSE: "/usr/lib/systemd/system"  
&nbsp;&nbsp;CentOS: "/usr/lib/systemd/system"

But that's not very elegant.

Ciao, Michael.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [November 10, 2016, 8:56pm UTC](https://forum.ansible.com/t/where-to-install-systemd-unit-files/23005/2 "2016-11-10T20:56:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [November 10, 2016, 9:26pm UTC](https://forum.ansible.com/t/where-to-install-systemd-unit-files/23005/3 "2016-11-10T21:26:25Z")

</div>

Kai Stian Olstad wrote:

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [November 10, 2016, 10:05pm UTC](https://forum.ansible.com/t/where-to-install-systemd-unit-files/23005/4 "2016-11-10T22:05:50Z")

</div>

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.
