[systemd-devel] Impossible to enable instantiated symlink (foo at bar)
Lennart Poettering
lennart at poettering.net
Mon Aug 18 10:22:01 PDT 2014
On Mon, 18.08.14 21:10, Andrei Borzenkov (arvidjaar at gmail.com) wrote:
> If foo at bar.service symlink is present, it is impossible to enable it:
>
> bor at opensuse:~> ll /run/systemd/system
> итого 8
> lrwxrwxrwx 1 root root 32 авг 18 21:06 foo at bar.service -> /run/systemd/system/foo at .service
> -rwxr-xr-x 1 root root 1032 авг 18 21:06 foo at .service
> bor at opensuse:~> sudo systemctl enable foo at bar.service
> Failed to issue method call: No such file or directory
> bor at opensuse:~>
>
> The problem is, unit_file_search() is called with allow_symlink=false
> when used in enable codepath, which means that every attempt to open
> will end up wither in ELOOP or ENOENT. At the end it exits with the
> last error (ENOENT in this case, but this obviously depends on in which
> directory symlink is created).
>
> Is it really intentional? I'm actually all for disallowing such
> symlinks :) but in this case at least meaningful error message is
> required.
Happy to take a patch which fixes the error to ELOOP if we hit ELOOP at
least once!
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list