when is a user really logged out (pmvarrun)

Fabian Stäber fabian at fstab.de
Mon Nov 20 13:34:32 UTC 2006


Hi,

I'm writing a small PAM module that can mount my truecrypt-encrypted home
directory using my login password. This should become a small module with
just a few lines of code.
Mounting the directory works fine, using pam_sm_authenticate().

Now I'm wondering when to unmount the home directory. The problem is that
the user might be logged in multiple times, so when the user
logs out, the module must check if there is still another open session.

I had a look at pam_mount, and it seems to use an external program
pmvarrun to keep track of the login count in /var/run/pam_mount.

Is there an easier way to determine the last logout?
May be calling who, or something like this?

I would appreciate any ideas.

Fabian.





More information about the Pam-list mailing list