[systemd-devel] Question about config_path and symlinks (NixOS issue)

Michael Hoy mjh at mjhoy.com
Mon Feb 22 22:46:09 UTC 2016


Hello,

I understand that systemd's design does not allow it to read install
information in unit file symlinks under /etc (reading through [1] and
[2] for instance).

I'm sure I don't fully grasp the issue: but why is it that `config_path`
in install.c:find_symlinks (see @ [3]) is opened with O_NOFOLLOW?
Couldn't the configuration directory itself be a symlink and not mix
install/configuration state?

In NixOS, `/etc/systemd/system` is a symlink. (This is AFAIK a
consequence of the design of their system. Perhaps in systemd's eyes
this makes it incompatible with systemd.) The problem is that because of
this `systemctl list-unit-files` and `systemctl is-enabled` do not work
correctly. (The bug: https://github.com/NixOS/nixpkgs/issues/1083)

I have been testing a small patch, here [4], and with it, those commands
now work for me and it seems to fix the problem I'm seeing. But perhaps
I've created new problems.

Thank you, any help is appreciated. I am quite new to systemd and
apologize if I am simply repeating old issues that have already been
resolved.

Mikey

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=955379#c14
[2]: https://github.com/systemd/systemd/commit/0ec0deaa30d0e
[3]: https://github.com/systemd/systemd/blob/7c7c0cbe640e33e/src/shared/install.c#L635
[4]: https://github.com/mjhoy/systemd/commit/5e45c1da38ba5


More information about the systemd-devel mailing list