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

2022-12-05 Thread lejeczek




On 16/10/2022 16:34, Lennart Poettering wrote:

On Fr, 14.10.22 10:59, lejeczek (pelj...@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




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

2022-10-16 Thread Lennart Poettering
On Fr, 14.10.22 10:59, lejeczek (pelj...@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?

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.

Lennart

--
Lennart Poettering, Berlin


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

2022-10-14 Thread Colin Guthrie

Andrei Borzenkov wrote on 14/10/2022 12:56:

On Fri, Oct 14, 2022 at 2:48 PM lejeczek  wrote:



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?


Without knowing how exactly your home directories are mounted it is
rather hard to answer. Are they mounted from within /etc/fstab?

Homes are mounted by other daemons started later(by systemd).



Have you tried to set those daemons Before=systemd-logind.service?



Or perhaps Before=systemd-user-sessions.service?

--

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/





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

2022-10-14 Thread Andrei Borzenkov
On Fri, Oct 14, 2022 at 2:48 PM lejeczek  wrote:
>
>
>
> On 14/10/2022 12:02, Andrei Borzenkov wrote:
> > On Fri, Oct 14, 2022 at 12:59 PM lejeczek  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?
> >>
> > Without knowing how exactly your home directories are mounted it is
> > rather hard to answer. Are they mounted from within /etc/fstab?
> Homes are mounted by other daemons started later(by systemd).
>

Have you tried to set those daemons Before=systemd-logind.service?


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

2022-10-14 Thread lejeczek




On 14/10/2022 12:02, Andrei Borzenkov wrote:

On Fri, Oct 14, 2022 at 12:59 PM lejeczek  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?


Without knowing how exactly your home directories are mounted it is
rather hard to answer. Are they mounted from within /etc/fstab?

Homes are mounted by other daemons started later(by systemd).

thanks, L.


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

2022-10-14 Thread Andrei Borzenkov
On Fri, Oct 14, 2022 at 12:59 PM lejeczek  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?
>

Without knowing how exactly your home directories are mounted it is
rather hard to answer. Are they mounted from within /etc/fstab?