[systemd-devel] Can /usr/lib/systemd/user/sockets.target.wants be used to autoenable a socket by a vendor package?

Andrei Borzenkov arvidjaar at gmail.com
Sun Sep 18 06:39:59 UTC 2022


On 18.09.2022 09:05, Yuri Kanivetsky wrote:
>> No, everything linked to a <unit>.wants/ directory immediately becomes a Wants= dep of <unit> and is therefore "enabled", it doesn't matter whether that .wants/ is in /etc or /usr/lib or /run.
> 
> To confirm this, I created the following files:
> 
> $ cat /usr/lib/systemd/user/infinite-tsukuyomi.service
> [Unit]
> Description=Infinite Tsukuyomi
> 
> [Service]
> ExecStart=/usr/bin/sleep infinity
> 
> $ ls -al /usr/lib/systemd/user/multi-user.target.wants/infinite-tsukuyomi.service
> lrwxrwxrwx 1 root root 29 Sep 18 08:45
> /usr/lib/systemd/user/multi-user.target.wants/infinite-tsukuyomi.service
> -> ../infinite-tsukuyomi.service
> 
> And rebooted the machine. The service didn't start. But starts
> manually if I tell it to. Is there anything I'm missing here?
> 

There is no multi-user.target for user systemd instances (nothing
prevents you from creating one, but it does not exist by default).


More information about the systemd-devel mailing list