Repository navigation
Consider aliases in /usr when disabling units - #14156
Conversation
|
So test-install-root unit test is now failing due to the fact that broken symlinks in the config paths are no more allowed. This can be fixed easily by using For instance the test creates the following dangling enablement symlink:
and the current code accepts it even if /usr/lib/systemd/system/a.service points to nowhere. If we're only interested in the generic name "a.service", wouldn't it have been better to use a symlink pointing to itself rather than allowing such dangling symlink ? |
|
@keszybz could you please have a look ? |
That is explicitly allowed and we must accept such symlinks. In particular, it is totally OK to create a symlink to a unit file in /etc, and than have that file moved to /usr/lib. Apart from that, I think the changes in this PR are good. |
Fair enough. I'm still wondering why we use (potentially dangling) symlinks in *.wants/ or *.requires/... empty files would have been less ambiguous IMHO. |
… a unit It might be needed to follow symlinks more deeply when we're looking for enablement symlinks pointing to the removed service. Let's consider the case where service 'old' is being renamed 'new' (will happen most likely during package upgrade). Before the service is going to be renamed, there's the following enablement symlink: /etc/systemd/system/multi-user.target.wants/old.service -> /usr/lib/systemd/system/old.service In order to rename 'old' into 'new' and transparently restart the service, the old name is still provided as a 'static' alias for the new service. This should also help keeping backward compatibilities since the old name might still be embedded in unit files, scripts, generators and such. Hence after the package is upgraded, the following symlinks including the enablement symlink are present: /usr/lib/systemd/system/old.service -> new.service /etc/systemd/system/multi-user.target.wants/old.service -> /usr/lib/systemd/system/old.service If later the user decides to disable the service, we should figure out that the enablement symlink (which still has the old name) is actually referring to 'new' (indirectly) even if it points to the alias.
a0ee79d to
972f317
Compare
Because empty files mean masking, and this would be very confusing. Things are as they are, a clean design from scratch would probably be different. |
|
@keszybz any chance you can review this one ? Thanks. |
|
LGTM. |
No description provided.