On Monday 21 August 2006 2:07 pm, Leendert Meyer wrote:
On Tuesday 08 August 2006 20:27, James D. Parra wrote:
Hello,
Short of rebooting, how to close an open session of a user who is logged in?
Would that be you, logged in more that once (perhaps using one or more different logins), or would that be another person?
If it's you, wel, you know best... ;)
If it's another person, perhaps "man shutdown" could be of use: it allows you to send a warning to all users who are logged in over a text console, together with specifying a delay (e.g. "Warning: the system will shut down in 5 minutes. Save your work and logout immediately."). I suppose you could come up with nicer messages... ;) The OP stated "short of rebooting". You can easily use the wall(1) command to broadcast a message to all those who are logged in. Or, you can use the write(1) command to send a message to a specific user.
Then, a simple kill(1) directed at the controlling terminal will cause any specific user to be logged out. You could write a simple shell or perl script to look at who is logged in (who), parse it to get the terminal (eg. pts/1 tty1, ttyS1, ...) then do a ps ax and simply kill all processes associated. -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9