[systemd-devel] WantedBy=default.target

Lennart Poettering lennart at poettering.net
Mon Mar 11 15:26:48 UTC 2019


On Do, 07.03.19 18:48, Tomasz Torcz (tomek at pipebreaker.pl) wrote:

> On Thu, Mar 07, 2019 at 11:24:08AM +0100, Lennart Poettering wrote:
> > 2. rtags (it uses default.target in a socket file, which is even
> >    weirder, should use sockets.target)
>
>   sockets.target is rather odd for me. If I had (hypothetical)
> socket-activable service, which is only relevant in GUI environment,
> I would like its socket to be pulled in by graphical.target. Using
> sockets.target would let my hypothetical service to be available in
> text-only boot.

Well, socket activation is a scheme to make sure that stuff that isn't
used doesn't cost you. i.e. listening on some socket is basically
free, as long as the daemon behind it is only started when
needed. Hence: I don't see why you would bother with fine tuning
listening on sockets for your case: it really doesn't matter if you
listen on three or five sockets, unless you use them the backing
service is not started anyway. And if those services *are* in fact
used, then it is of course the right thing to just make them work.

But I mean, if you really want to micro-optimize like that (though I'd
advise you not to), you can define your service to be pulled in by
graphical.target but also declare Before=sockets.target. In that case
when you boot into graphical.target the socket is started, but still
properly synchronized into early boot.

Lennart

--
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list