[systemd-devel] Can /usr/lib/systemd/user/sockets.target.wants be used to autoenable a socket by a vendor package?
Barry
barry at barrys-emacs.org
Tue Sep 20 07:42:54 UTC 2022
> On 18 Sep 2022, at 13:08, Yuri Kanivetsky <yuri.kanivetsky at gmail.com> wrote:
>
>
>>
>>> $ 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
Enabled does mean that it will or will not run.
It means that it is wanted by the default target.
Barry
>
> 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