I understand that systemd
stores unit files at different locations for different versions of Linux. On RHEL, it's at /usr/lib/systemd/system/
, whereas on Debian-based machines it's at /lib/systemd/system/
.
However, on my Ubuntu 18.04 machine, I just installed Elasticsearch using a .deb
file, and its systemd
unit file was installed under /usr/lib/systemd/system/
, but systemd
is still able to pick it up.
$ uname -a
Linux nucleolus 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ sudo systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: http://www.elastic.co
Note the path is /usr/lib/systemd/system/elasticsearch.service
.
So why does a systemd
unit file at /usr/lib/systemd/system/
still works for Ubuntu? What is the real unit file load path for Debian/Ubuntu systems?
/lib/systemd/system/
instead of/usr/lib/systemd/system/
. – Haxiel Mar 24 '19 at 5:09/lib/
simply as a symlink to/usr/lib/
to maintain compatibility with programs that use/lib/
as the library directory. Dols -l /
andls -l /usr/
to see whichlib/
you have as a directory. – Mio Rin Mar 24 '19 at 6:56