[comp.os.vms] How do you detect login/logout?

Larry_J_Osterman@cup.portal.com (11/07/87)

Forgive me if this has been discussed here before, I don't remember it if so.

We need to detect when a user logs in and out without having the user execute
something in login.com or sylogin.com.  The best we've done so far is have
sylogin run a program which writes a mailbox to tell us that a new user is
logging in.  Then the login program locks a resource using an exclusive lock.
The monitoring program (the reader of the mailbox) then attempts to enqueue
a lock on that same resource, specifying an ast be invoked when the lock is
granted.  Since the login program has an exclusive lock, the ast doesn't
get invoked until the user logs out.

This scheme forces us to execute something at login time, but at least we don't
have to execute something at logout time (which we have much less control over
than at login).  But we sure would like to find some way to detect BOTH login
and logout without any action on the new user's part.

Any help would be greatly appreciated.

Larry Osterman
larry_j_osterman@cup.portal.com
sun!cup.portal.com!larry_j_osterman

mason@usfvax2.UUCP (Jeff Mason) (11/10/87)

Well, you could have a daemon periodically check the UAF file to see 
when the last login for each user was, then update this to a file containing
the log of logins.  You can also use accounting, which contains the 
login and logout time of interactive and non-interactive processes.