[K12OSN] cron to kill users or group?

Petre Scheie petre at maltzen.net
Fri Mar 24 18:24:31 UTC 2006


I've been considering something like this:

for x in `cat file-of-IDs-to-be-logged-off`
do
pkill -u $x
done

for similar reasons.  Put the above in a script, call it via root's cron 
in the middle of the night, and when people arrive in the morning, 
everyone and their sessions will have been reset.  The reason to use a 
file for the IDs is that you don't want to kill every ID that has things 
running, for example, root, apache, yourself perhaps, etc.  So, in the 
file you just put your users' IDs.

HTH.

Petre

William Fragakis wrote:
> Hi,
> An issue we frequently have is that repeated instances of programs 
> orphaned eventually bring down a server. It arises from a couple of 
> situations: 1) a client crashing then gets rebooted or 2) multiple 
> instances of a program are opened (eg TuxPaint) instead of using an 
> already open program. The second type is the more difficult because we 
> have a lot of young kids and in a special situation, special needs kids 
> - so we want something transparent to them. We'd rather sort the problem 
> out on the server side than "educate" them since exploring the computer 
> is so much fun for them. I've found scripts that kill a certain user, 
> I've found scripts that kill certain processes but what I'd like is 
> something that ends all the regular user processes, say, at midnight and 
> let's the clients "refresh" without having to reboot or log back in. I 
> don't want to restart the server every night - well, because it's a 
> server and we love our uptime.
> 
> Is anyone using anything to end the processes for a certain group, say, 
> as a cron job?
> 
> TIAA
> William Fragakis
> Morris Brandon Elementary
> 
> Side note: AbiWord is so screaming fast to launch and lightweight- any 
> thought about making it part of the default install? Not that it's hard 
> to add but it is so much faster than OO.
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
> 




More information about the K12OSN mailing list