[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#425314: $HOME still in use after session has been closed - Steps to reproduce



Sune Vuorela wrote:
>> If you now login and logout again, umount and removal of the
>> encrypted device will fail. Enabling debug mode in
>> /etc/security/pam_mount.conf will show three kdeinit
>> processes keeping $HOME and $HOME/.xsession-errors open.
> 
> First step is to figure out which kdeinit processes that still think they are 
> running - and then keeping $HOME open.
> 
> If you could modify the startkde script (take a backup copy first)
> and just before the final "echo 'startkde: done'" line, add some lines to 
> generate some output. You need lsof (from the lsof package).
> 
> lsof > /tmp/openfiles  #this is unsecure if it is a multiuser box
> ps x > /tmp/processes  #this is also unsecure if it is a multi user box
>
> that way, we can see what processes exactly that keeps it open.

I followed your guidelines, here is what I got:

"ps x" output:
---------------
  PID TTY      STAT   TIME COMMAND
 3352 ?        Rs     0:00 /bin/sh /usr/bin/x-session-manager
 3392 ?        Ss     0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager
 3395 ?        S      0:00 /usr/bin/dbus-launch --exit-with-session x-session-manager
 3396 ?        Ss     0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
 3473 ?        S      0:00 kdeinit Running...
 3489 ?        R      0:00 ps x

The output for different runs returned the same commands, on some occasions
dbus-launch and dbus-daemon were swapped in order.


"lsof" output (filtered for $HOME):
-------------

x-session 3352      foobar  cwd       DIR      254,0    4096         2 /home/foobar
x-session 3352      foobar    1w      REG      254,0     966        12 /home/foobar/.xsession-errors
x-session 3352      foobar    2w      REG      254,0     966        12 /home/foobar/.xsession-errors
kdeinit   3473      foobar  cwd       DIR      254,0    4096         2 /home/foobar
kdeinit   3473      foobar    1w      REG      254,0     966        12 /home/foobar/.xsession-errors
kdeinit   3473      foobar    2w      REG      254,0     966        12 /home/foobar/.xsession-errors
lsof      3487      foobar  cwd       DIR      254,0    4096         2 /home/foobar
lsof      3487      foobar    2w      REG      254,0     966        12 /home/foobar/.xsession-errors
lsof      3488      foobar  cwd       DIR      254,0    4096         2 /home/foobar

The output was identical for all runs.


I'm still trying to grasp what is going on in the background of an X
session (quite interesting actually!), but one question keeps
coming up: Shouldn't the PAM session (which triggers libpam-mount to
umount) only be closed after the X session has been closed, ie after
the above processes have exited?

Regards,
Christian

-- 
Christian Kastner
PGP Key: AE90E13F



Reply to: