PDA

View Full Version : User Login Issues




MacHamman
Jan 4, 2007, 11:24 AM
Hey everyone, I work for a University and we have a issue that I am stumped on. Students have been complaining about the iMacs we have rebooting after doing updates at the scheduled time during the night. To fix this we thought it would be a good idea to write a shell script to check whether a user is logged into the system and put it into crontab to be run alongside the update scripts. This script would tell the computer to not reboot until the user logs out of the machine.

The problem I am having is which UNIX command to use. The 'users', 'whoami', and 'who' commands keep their values from whomever was logged into the system last and 'finger' says that no one is logged when someone is. So I am wondering is there another command that I could try.

I had another thought of checking if the login window is active, but have been unable to find the command. We are using Kerberos to login to the Windows Active Directory system here on campus. Any help would be appreciated. Thanks

MacHamman



jeremy.king
Jan 4, 2007, 01:37 PM
The who command *should* work.

You could always process the /var/run/utmp and /var/log/wtmp logs yourself.

MacHamman
Jan 8, 2007, 10:40 AM
The who command *should* work.

You could always process the /var/run/utmp and /var/log/wtmp logs yourself.

Well, the problem is the 'who' command does not clear out the ttyp1 logins from a user. The console logs are cleared, but not the ttyp1.