[K12OSN] scripting advice re teachertool
petre at maltzen.net
petre at maltzen.net
Fri Jan 13 13:54:23 UTC 2006
I think Eric's method is more bulletproof. Many times when I've tried to
kill all the processes for a given user, they don't all die at the same
time, some taking longer than others. I'll run 'ps -ef |grep $user' and
then kill -15 the PIDs by hand, and then run 'ps -ef ' again, and some
processes will still be out there. So, then I 'kill -9' those remaining
processes, only to be told they don't exist, do the ps again, and indeed
they have disappeared.
Eric's approach allows that some processes will be slackers.
OTOH, I like the look of your appoach: shorter, more succinct. But I
think in this case you should choose function over form.
> I log users off like this in fl_TT
>
> skill -15 -u user || skill -9 -u user
>
> but I noticed Eric uses this method in his purge_users script
>
> # first do it nicely
> pkill -u user
> # wait a couple seconds
> sleep 2s
> # now do it the hard way
> pkill -9 -u user
>
> are there any differences or advantages to these methods??
> I ask because I'm getting reports of the first method not working 100%
> of the time.
> --
> Robert Arkiletian
> C++ GUI tutorial http://fltk.org/links.php?V19
>
> _______________________________________________
> 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