[systemd-devel] user unit with delayed users homes mount - ?

lejeczek peljasz at yahoo.co.uk
Mon Dec 5 14:31:50 UTC 2022



On 16/10/2022 16:34, Lennart Poettering wrote:
> On Fr, 14.10.22 10:59, lejeczek (peljasz at yahoo.co.uk) wrote:
>
>> Hi guys.
>>
>> I'm on Centos 8 S with systemd 239.
>> Users homes are mounted at later (latest?) stage off NFS so when such a user
>> logs in then:
>>
>> -> $ systemctl --user status -l xyz.service
>> Unit xyz.service could not be found.
>> -> $ systemctl --user daemon-reload
>> -> $ systemctl --user status -l xyz.service
>> ● xyz.service - Podman container-xyz.service
>>     Loaded: loaded (/apps/appownia/.config/systemd/user/xyz.service; enabled;
>> vendor preset: enabled)
>>     Active: inactive (dead)
>>       Docs: man:podman-generate-systemd(1)
>>
>> Is it possible and if so then how, to make "systemd" account for such a
>> "simple" case - where home dir is net mounted very late?
> I don't get this scenario. You talk to the systemd --user instance,
> which is the per-user instance, so $HOME of that user should be
> mounted at that time. But then you issue a reload and new stuff
> appears and you appear to suggest that now the user's $HOME was
> mounted?
Yes, it appears that systemd 'misses' user's units - @ boot 
time I guess and later does not do anything about them 
'homes' getting mounted later(too late for systemd?)
When I login to that user it seems that systemd sees no 
unit's - at that point homes are mounted of course - and I 
have to poke systemd manually with:
-> $ systemctl --user daemon-reload
at which point, it seems, system re-check user's home
It is PCS service/daemon which is a part of or rather 
manages, a couple of other daemons which together do a HA.
For 'pcs' I've tried
[Unit]
Before=systemd-logind.service
Before=systemd-user-sessions.service

but do not avail.

> So what now? Usually, the assumption is that first the user logs in,
> which is the point where $HOME must be mounted at the latest, and then
> systemd --user gets started off it and the user's login session is
> allowed to begin.
I really do not know what to assume - I can only tell you 
what happens.
Ideal scenario - which I'm hoping it is possible to make 
work - is when a given user does not have to log in at at.
As you can see in this case, it is a container(podman) unit 
which I hope a 'lingered' session shall manage without user 
interventions.

many thanks, L>
>
> Lennart
>
> --
> Lennart Poettering, Berlin



More information about the systemd-devel mailing list