systemd system unit files and UsrMove

Lennart Poettering mzerqung at 0pointer.de
Mon Feb 20 12:02:11 UTC 2012


On Fri, 17.02.12 10:46, Nathaniel McCallum (nathaniel at natemccallum.com) wrote:

> I'm a fan of systemd [1]. And although I didn't like the fact that unit
> files were stored in /lib, I understood the rationale since there was no
> /share. However, I've just recently discovered [2] that after UsrMove unit
> files will be stored in /usr/lib. Can we not do better than this? And I'd
> really rather not work around the problem [3].
> 
> Seriously, please don't do this.

The unit files are in /lib for a couple of reasons. Firstly, before the
/usr merge there was no /share, so we had to place them in
/lib. Secondly I think that /lib is actually the better fit for them,
simply because I consider them closely related to the code they wrap,
and code belongs in lib, libexec or bin. How does that matter? Well, the
unit files are very often dependendent on/closely related to the
architecture, and make little sense to share them between archs. This
applies to a couple of units we ship with systemd itself (for example
the hugepages mount unit), but even more often to unit we don't ship
ourselves (think mcelog). And distributing these unit files among a
number of dirs would seriously suck.

We need to retain compatibility for the directory from before the /usr
merge and I think lib/ is actually a better place for this than share/,
hence I think I see little reason to move this.

/share is a great place for truly arch independent data that is shared
between multiple applications, and which is read by multiple
applications (such as icons, man pages, dictionaries and suchlike). But
for stuff that is very close to specific bits of code, and is only read
by a single tool /lib is the much better place I think. A good way to
think about this is maybe "if I remove something in /lib it seriously
impacts the control flow of code" vs. "if I remove something in /share
it hast little impact on control flow".

Something similar applies to udev rules and similar "almost code" bits.

But yeah, I know people will disagree with us on this. Maybe a different
way to think about this is to think about shell scripts. We ship those
in /bin, and not in /share either. And it is good that way. And if that
still doesn't convince you, then I hope at least the "keep compat" issue
pointed out above matters enough to you.

So, no plans to move the unit files to /usr/share. Sorry.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the devel mailing list