Bug#959917: systemd: unit file Alias= leads to dangling symlink

Michael Biebl biebl at debian.org
Thu May 7 07:11:30 BST 2020


Control: tags -1 + moreinfo
Am 07.05.20 um 02:51 schrieb Christoph Anton Mitterer:
> Package: systemd
> Version: 245.5-2
> Severity: normal
> 
> 
> Hey.
> 
> I've just noted the following behaviour.
> 
> /lib/systemd/system/smartmontools.service has:
> [Install]
> WantedBy=multi-user.target
> Alias=smartd.service
> 
> 
> Which leads to:
> # tree /etc/systemd/system
> /etc/systemd/system
> ├── multi-user.target.wants
> │   ├── smartd.service -> /lib/systemd/system/smartd.service
> │   ├── smartmontools.service -> /lib/systemd/system/smartmontools.service
> │   └── ...
> ├── smartd.service -> /lib/systemd/system/smartmontools.service
> ...
> 
> With /etc/systemd/system/multi-user.target.wants/smartmontools.service being
> a dangling symlink to the non-existant /lib/systemd/system/smartd.service .
> 
> /etc/systemd/system/smartd.service is however created with the correct
> destination.
> 
> 
> This stays if one disables/enables the unit, i.e. it's re-created with
> the dangling symlink.

Are you absolutely sure, this symlink was created by `systemctl enable`?
I'm asking, because I can't reproduce that systemctl creates such a symlink.

$ sudo systemctl enable smartmontools.service
Synchronizing state of smartmontools.service with SysV service script
with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable smartmontools
Created symlink /etc/systemd/system/smartd.service →
/lib/systemd/system/smartmontools.service.
Created symlink
/etc/systemd/system/multi-user.target.wants/smartmontools.service →
/lib/systemd/system/smartmontools.service.


$ ls -la /etc/systemd/system/multi-user.target.wants/smartd.service
ls: cannot access
'/etc/systemd/system/multi-user.target.wants/smartd.service': No such
file or directory

What's the timestamp of the dangling smartd.service symlink?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20200507/e959e60c/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list