I tend to think you're best solution would be one that didn't require
that external program to be running and maintaining login status. Doing
some quick research, I believe using utmp should be able to give you an
accurate count of who's logged in and therefore be able to give you a
count of the remaining sessions for your particular user. Take a look
at utmp(5).<br>
<br>
-- Jon Miller<br><br><div><span class="gmail_quote">On 11/20/06, <b class="gmail_sendername">Fabian Stäber</b> <<a href="mailto:fabian@fstab.de">fabian@fstab.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I'm writing a small PAM module that can mount my truecrypt-encrypted home<br>directory using my login password. This should become a small module with<br>just a few lines of code.<br>Mounting the directory works fine, using pam_sm_authenticate().
<br><br>Now I'm wondering when to unmount the home directory. The problem is that<br>the user might be logged in multiple times, so when the user<br>logs out, the module must check if there is still another open session.<br>
<br>I had a look at pam_mount, and it seems to use an external program<br>pmvarrun to keep track of the login count in /var/run/pam_mount.<br><br>Is there an easier way to determine the last logout?<br>May be calling who, or something like this?
<br><br>I would appreciate any ideas.<br><br>Fabian.<br><br><br>_______________________________________________<br>Pam-list mailing list<br><a href="mailto:Pam-list@redhat.com">Pam-list@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/pam-list">
https://www.redhat.com/mailman/listinfo/pam-list</a><br></blockquote></div><br><br clear="all"><br>-- <br>Later,<br>Jon