[K12OSN] Automatic user logout script?

Petre Scheie petre at maltzen.net
Mon Dec 11 18:59:19 UTC 2006


You, too, are correct.  Okay, so I'm 0 for 2.  ;-)  But hey, that's the whole point of 
the peer-review process of a mailing list.

Petre

Dan Young wrote:
> I think your "pkill $ID" needs to be "pkill -u $ID"
> 
> pkill w/o options matches on process names, so you'd be trying to kill
> processes called $ID rather than owned by $ID.
> 
Petre Scheie wrote:
 > > Yes, it should!  And here I had the gall--the gall!--to suggest to my
 > > son that he check his homework before handing it in to his teacher.
 > > ;-)  Thanks Robert.
 > >
 > > Petre
 > >
 > > Robert Arkiletian wrote:
 >> >> On 12/8/06, Petre Scheie <petre at maltzen.net> wrote:
 >>> >>> How about this:
 >>> >>>
 >>> >>> #!/bin/bash
 >>> >>> for ID in $(awk -F: '$3 >= 500 {print $1}')
 >> >>
 >> >> shouldn't that be
 >> >>
 >> >> for ID in $(awk -F: '$3 >= 500 {print $1}' /etc/passwd)
 >> >>
 >>> >>> do
 >>> >>> pkill $ID
 >>> >>> done
 >>> >>>
 >>> >>> Put this into a file, make it executable (chmod +x), and then set
 >>> >>> root's crontab to run
 >>> >>> it at, say 5pm.  Fedora defaults to starting user UID numbers at 500
 >>> >>> and going up from
 >>> >>> there, so we avoid killing any system processes.
 >>> >>>
 >>> >>> Petre
 >>> >>>
 >>> >>> Jim Anderson wrote:
 >>>> >>> > Is there a script available to automatically log out users at the
 >>> >>> end of
 >>>> >>> > the day from K12LTSP?  I have users that tend to leave while still
 >>>> >>> > logged in.  Relatedly, is there a way to force a logout remotely
 >>> >>> from a
 >>>> >>> > terminal prompt as root?
 >>>> >>> >
 >>>> >>> > K12LTSP v.5.0
 >>>> >>> > Dell Pentium D 2.8 GHz, 2 GB RAM
 >>>> >>> > 24 GX1 clients
 >>>> >>> >
 >>>> >>> > Jim
 >>>> >>> >
 >>>> >>> >
 >>>> >>> > _______________________________________________
 >>>> >>> > K12OSN mailing list
 >>>> >>> > K12OSN at redhat.com
 >>>> >>> > https://www.redhat.com/mailman/listinfo/k12osn
 >>>> >>> > For more info see <http://www.k12os.org>
 >>>> >>> >
 >>> >>>
 >>> >>> _______________________________________________
 >>> >>> K12OSN mailing list
 >>> >>> K12OSN at redhat.com
 >>> >>> https://www.redhat.com/mailman/listinfo/k12osn
 >>> >>> For more info see <http://www.k12os.org>
 >>> >>>
 >> >>
 >> >>
 > >
 > > _______________________________________________
 > > K12OSN mailing list
 > > K12OSN at redhat.com
 > > https://www.redhat.com/mailman/listinfo/k12osn
 > > For more info see <http://www.k12os.org>
 > >


_______________________________________________
K12OSN mailing list
K12OSN at redhat.com
https://www.redhat.com/mailman/listinfo/k12osn
For more info see




More information about the K12OSN mailing list