[systemd-devel] How soon after login can I rely on systemd --user having reached sockets.target?

Colin Guthrie gmane at colin.guthr.ie
Tue Oct 28 09:27:06 PDT 2014


Lennart Poettering wrote on 27/10/14 18:11:
> On Thu, 23.10.14 17:26, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> 
>>> order it after basic.target (which things are by default anyway)...
>>>
>>> My proposal now, (which is the same Damien's as I understood him):
>>>
>>> 1. pam_systemd should sync on default.target
>>> 2. by default default.target should just be an alias to basic.target.
>>>
>>> That way we have two things:
>>>
>>> a) as basic.target pulls in all sockets and busnames we know that
>>>    everything that needs to be listened on is listened on by the time
>>>    PAM succeeds
>>>
>>> b) if people really want they can change the default.target symlink to
>>>    something else and thus add additional services into this, that may
>>>    run after the sockets/busnames, but before PAM succeeds.
>>>
>>> Makes sense?
>> Not to me. It still potentially delays user login a lot, because
>> it conflates things which should be started by default with things
>> which should be started before login completes.
>>
>> If I want to start a bunch of daemons whenever my systemd instance is
>> running, I want to add them to default.target, that's what it is there
>> for. I see a strong parallel with the system default.target: it
>> specifies what should be launched on boot, but user logins are allowed
>> much earlier.
>>
>> Maybe this should be made explicit and PAM should wait for a new
>> user-login.target, which by default will simply have Wants=basic.target,
>> but the user is free to add additional dependencies if they want to
>> have more stuff running before they are allowed to log in.
> 
> I see what you mean. But "user-" sounds like an unnecessary prefix, if
> we are already in user context, no?
> 
> Maybe just "login.target"?

Yeah this seems sensible to me. I certainly like it better than
default.target

It actually felt kinda weird using WantedBy=default.target seeing as
this is typically a symlink under system-mode where we're much more used
to using multi-user.target. Now that I've thought about it all, I'm not
sure whether it is using WantedBy=default.target in user-mode that feels
wrong, or NOT using WantedBy=default.target in system-mode that *should*
feel wrong :p

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list