Re: Encrypted home and pam_mount
On Sun, 2024-03-03 at 21:27 +0700, Max Nikulin wrote:
> On 03/03/2024 02:46, Andrey Dogadkin wrote:
> > Automounting works fine, but I'm having trouble with auto-
> > unmounting
> > when I log out. The partition stays mounted and I can see "target
> > is
> > busy" errors from umount in the journal.
>
> It is an issue with ecryptfs and fscrypt as well.
>
> https://github.com/systemd/systemd/issues/8598#issuecomment-376845082
> "systemd-user doesn't properly close its PAM session"
I saw that issue and it didn't strike me as related to my case,
pam_mount works fine as long as I allow it to shoot everything down.
> systemd-logind default settings have UserStopDelaySec=10 so some
> processes are still running after the session is finished.
Setting UserStopDelaySec to 0 gave me the same results.
The thing is, even if I set absurdly big wait delay in pam_mount's
logout statement, I can still observe pulseaudio and dbus-daemon
running throughout the whole delay period. Systemd makes no attempt to
stop them before or while pam_mount is running, that's why it seems
like an ordering problem rather than just things being late.
> Depending on desktop environment or window manager you may try
>
> systemctl --user start exit.target
>
> during logout if the user has no other sessions (SSH, VT, etc.)
I guess I'll stick with <logout> for now. If I have to force things
into behaving properly, might as well let pam_mount do it for me :)
Thank you for your reply
> I have not tried systemd-homed
> https://systemd.io/HOME_DIRECTORY/
>
>
Reply to: