Posted on 09-22-2009 04:52 PM
I'm managing logout on public machines for a certain amount of time
idle, but there are certain applications that prevent that from
happening. Safari, being one of them, paper-cut being another. I see
this also, when a network user clicks "log off" and then they don't
catch that Safari needs to be quit or they didn't save that
untitled.docx ... Well, now there's a machine sitting at a screensaver
that only an admin or that user can bypass.
What can I do to make sure that logout MEANS logout. A "do not pass go"
script, of sorts... ?
thanks,
-
lauren
-
LAUREN NICHOLAS
User Support Analyst - Hurd (South) Campus
Center for Information Technology - CIT
Moravian College
ph. 610 861 1633
lpnicholas at moravian.edu
Posted on 09-22-2009 05:56 PM
Hi Lauren-
I think you could very easily do this with a script using killall. It unceremoniously dumps an app - no chances for user interaction, just kills it. You could go about it one of two ways: very directed or buckshot. If there are specific applications that are causing the problem, I'd go with directed. If you're unsure of what you want to kill, you could go buckshot. Here's the gist of each way:
#!/bin/sh
## Get the current owner of console, which is the logged in user. Use cut to isolate the username only
user=ls -l /dev/console | cut -d " " -f 4
## kill all processes owned by the logged in user - careful though, this is likely complete overkill and may have unexpected results
killall -u $user *
### kill only the problem processes
## kill Safari
killall -u $user Safari
## kill any MS products
killall -u $user Microsoft*
## kill Firefox
killall -u $user firefox-bin
exit 0
j
---
Jared F. Nichols
Desktop Engineer, Infrastructure & Operations
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436
Posted on 09-23-2009 09:54 AM
The following command has worked for me to force users to log off in the past:
killall loginwindow
Dave
--
David Lundgren
Sr. IT Systems Administrator
Brooks Institute - "Passion. Vision. Excellence."
27 East Cota Street
Santa Barbara, CA 93101
(805) 690-7615 (office)
(888) 304-3456 (toll-free)
http://www.brooks.edu