[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 12:08:29 UTC 2022
> > $ 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).
Good point. When I symlink it into
/usr/lib/systemd/user/default.target.wants it starts on boot.
Also, I've created a simple perl server:
https://gist.github.com/x-yuri/45f53c16a99337ba0716a988290491bd
And if I put perl-server.socket and perl-server.service into
/usr/lib/systemd/user, and symlink perl-server.socket into
/usr/lib/systemd/user/sockets.target.wants, it autoactivates on boot.
The confusing thing though is:
$ systemctl --user is-enabled perl-server.socket
disabled
And the fact that enable/preset/disable create/remove symlinks in
~/.config/systemd/user/sockets.target.wants.
Which doesn't happen with a service (e.g. infinite-tsukuyomi) when the
service is in /usr/lib/systemd/user.
Regards,
Yuri
More information about the systemd-devel
mailing list