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

Yuri Kanivetsky yuri.kanivetsky at gmail.com
Sun Sep 18 06:05:03 UTC 2022


> 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?

Regards,
Yuri


More information about the systemd-devel mailing list