[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Automatic user logout script?



Hey, I've sent my fair share of "brown-bag" shell scripts to the mailing
list. I've come to believe that it's better to provide a near-miss
(optimally phrasing it w/ a "caveat emptor", using "echo"s instead of
"rm -rf"s and all that) than nothing at all. To wit:

http://headrush.typepad.com/creating_passionate_users/2006/12/how_to_build_a_.html
http://tinyurl.com/y2jvu5

-- 
Dan Young <dyoung mesd k12 or us>
Multnomah ESD - Technology Services
503-257-1562

Petre Scheie wrote:
> 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 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 redhat com
>>>>> >>> > https://www.redhat.com/mailman/listinfo/k12osn
>>>>> >>> > For more info see <http://www.k12os.org>
>>>>> >>> >
>>>> >>>
>>>> >>> _______________________________________________
>>>> >>> K12OSN mailing list
>>>> >>> K12OSN redhat com
>>>> >>> https://www.redhat.com/mailman/listinfo/k12osn
>>>> >>> For more info see <http://www.k12os.org>
>>>> >>>
>>> >>
>>> >>
>> >
>> > _______________________________________________
>> > K12OSN mailing list
>> > K12OSN redhat com
>> > https://www.redhat.com/mailman/listinfo/k12osn
>> > For more info see <http://www.k12os.org>
>> >
> 
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN redhat com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN redhat com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]