Hello,

I'm using libpam-mount to mount/umount my dm-crypt'ed home directory
upon login/logout.

umount of my home directory and removal of the dm-crypt'ed device always
fails because a 'kdeinit' process keeps $HOME/.xession-errors open after
logout, and supposedly after my session has been closed (kdm claims to
have done so in auth.log, at least).

All I could find out so far is that the offending kdeinit process is
started *after* I logout (I determined this through acct).

The man page says kdeinit is a process launcher, so I'm guessing the
real offender is some other process. Can anybody give me any hints on
how I might figure out what kdeinit is launching?

Is it safe for kdm (or any ?dm) to rely on a file in $HOME after the
session has been closed? I'm not calling bug, I'm just asking out of
curiosity.

I've attached a sample snippet from my auth.log file for an entire
session (libpam-mount was running in debug mode).

Regards,
Chris

--
Christian Kastner
PGP Key: AE90E13F

May 7 00:12:27 ckdesk kdm: :0[12492]: (pam_unix) session opened for user chris by (uid=0)
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(readconfig.c:197) reading options_allow...
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(readconfig.c:180) reading options_require...
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:439) back from global readconfig
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:441) per-user configurations not allowed by pam_mount.conf
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:459) pam_sm_open_session: real uid/gid=0:0, effective uid/gid=0:0
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(readconfig.c:418) checking sanity of volume record (/dev/md0)
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:474) about to perform mount operations
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:368) information for mount:
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:369) ----------------------
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:370) (defined by globalconf)
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:373) user: chris
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:374) server:
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:375) volume: /dev/md0
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:376) mountpoint: /home/chris
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:377) options: fsck,exec,nosuid,nodev,fstype=jfs,cipher=aes-cbc-essiv:sha256,hash=sha512,keysize=256
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:378) fs_key_cipher: aes-256-cbc
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:379) fs_key_path: /autofs/keychain/chris.home.key
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:380) use_fstab: 0
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:381) ----------------------
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:177) realpath of volume "/home/chris" is "/home/chris"
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:182) checking to see if /dev/mapper/_dev_md0 is already mounted at /home/chris
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:799) checking for encrypted filesystem key configuration
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:803) decrypting FS key using system auth. token and aes-256-cbc
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:819) about to start building mount command
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(misc.c:264) command: /bin/mount [-t] [crypt] [-ofsck,exec,nosuid,nodev,fstype=jfs,cipher=aes-cbc-essiv:sha256,hash=sha512,keysize=256] [/dev/md0] [/
May 7 00:12:27 ckdesk kdm: :0[12559]: pam_mount(misc.c:341) set_myuid(pre): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:12:27 ckdesk kdm: :0[12559]: pam_mount(misc.c:376) set_myuid(post): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:851) mount errors (should be empty):
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) pam_mount(misc.c:341) set_myuid(pre): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) pam_mount(misc.c:376) set_myuid(post): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(mount.c:854) waiting for mount
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:123) clean system authtok (0)
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(misc.c:264) command: /usr/sbin/pmvarrun [-u] [chris] [-o] [1]
May 7 00:12:27 ckdesk kdm: :0[12574]: pam_mount(misc.c:341) set_myuid(pre): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:12:27 ckdesk kdm: :0[12574]: pam_mount(misc.c:376) set_myuid(post): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:360) pmvarrun says login count is 1
May 7 00:12:27 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:491) done opening session
May 7 00:13:22 ckdesk kdm: :0[12492]: (pam_unix) session closed for user chris
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:533) received order to close things
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:534) real and effective user ID are 0 and 0.
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(misc.c:264) command: /usr/sbin/pmvarrun [-u] [chris] [-o] [-1]
May 7 00:13:22 ckdesk kdm: :0[12790]: pam_mount(misc.c:341) set_myuid(pre): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:13:22 ckdesk kdm: :0[12790]: pam_mount(misc.c:376) set_myuid(post): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:360) pmvarrun says login count is 0
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:556) going to unmount
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:368) information for mount:
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:369) ----------------------
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:370) (defined by globalconf)
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:373) user: chris
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:374) server:
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:375) volume: /dev/md0
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:376) mountpoint: /home/chris
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:377) options: fsck,exec,nosuid,nodev,fstype=jfs,cipher=aes-cbc-essiv:sha256,hash=sha512,keysize=256
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:378) fs_key_cipher: aes-256-cbc
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:379) fs_key_path: /autofs/keychain/chris.home.key
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:380) use_fstab: 0
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:381) ----------------------
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(misc.c:264) command: /usr/bin/lsof [/home/chris]
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:131) lsof output (should be empty)...
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) kdeinit 12767 chris cwd DIR 253,4 4096 2 /home/chris
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) kdeinit 12767 chris 1w REG 253,4 2005 25 /home/chris/.xsession-errors
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) kdeinit 12767 chris 2w REG 253,4 2005 25 /home/chris/.xsession-errors
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:133) waiting for lsof
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(misc.c:264) command: /sbin/umount.crypt [/home/chris]
May 7 00:13:22 ckdesk kdm: :0[12793]: pam_mount(misc.c:341) set_myuid(pre): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:13:22 ckdesk kdm: :0[12793]: pam_mount(misc.c:376) set_myuid(post): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:487) umount errors (should be empty):
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) pam_mount(misc.c:341) set_myuid(pre): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) pam_mount(misc.c:376) set_myuid(post): real uid/gid=0:0, effective uid/gid=0:0
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) umount: /home/chris: device is busy
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) umount: /home/chris: device is busy
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:100) umount.crypt: error unmounting /home/chris
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(mount.c:490) waiting for umount
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:558) unmount of /dev/md0 failed
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:567) pam_mount execution complete
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:106) Clean global config (0)
May 7 00:13:22 ckdesk kdm: :0[12492]: pam_mount(pam_mount.c:123) clean system authtok (0)