Well, I had this delima just a few weeks ago. My problem was that
users are using the modems on our modem pool to dial out and never
hanging up, leaving their connection open to Indonesia and Canada,
etc... I fixed this by first trying to write a cu-wrapper, but
that failed because after I made it, you have to execute the "wrapper"
or the starting program as uucp or root to execute the cu-wrapper
which is the real "cu" program. Before going "online" with this
wrapper which logs who, what, when, where, and for how long, I
wanted to make sure there was no problems because this program
will have to be ran as root. Well, the problem is that I forgot
that I could "shell-out" of the cu connection with the ~! and
execute programs or run-around as root... so, that's not a good
idea and I canned that program... Then the next thing I made was
a program called "ideld". This will monitor anyone calling out via
modem and sleeps for 10 minutes. When it wakes up it checked the
uustat -p and writes anyone down over X hours long. If they are
on over 2 hours, it writes it down to a file and sends a message
to that device or their port, then it sleeps for another 10 minutes.
After it wakes up, it will check any processes that were pending and
kill their cu session and echo a message to their terminal that
they were killed for being on over x hours and x minutes. The program
logs this activity to a file and send e-mail to the user and to root.
-- Shane Kinsch
_/ Shane T Kinsch BRITE VOICE SYSTEMS, INC. _/
_/ shane .
com UNIX SYSTEM ADMINISTRATOR _/
_/ Wichita, KS USA VP UNIX ENGINEERING _/
_/ http://www.brite.com "MIME is ok here" _/
On Thu, 21 Mar 96 13:48:29 SYD pmoen @
>>From my (small, tiny) knowledge of UNIX,
>here's a roundabout way of achieving a solution
>the "w" command usually contains a field
>indicating how long a user has been idle
>write a script which
>pipes the result of "w" to grep, which
>sorts the idle field for users over 15 minutes
>and kills those users login shells
>(assuming you have the authority to do that) :) hmmm power
>run the script in the background every 10 minutes
>or so, so it doesn't hog system resources.
>If this is a totally stuffed solution, someone
>post the correct way.
>you didn't expect the code did you... :)
>"Jim Meritt" <jmeritt @
>| I'm looking for a way to do this (besides setting and
>| exporting TMOUT in the
>| /.profile for ksh users) on solaris systems.
>| Jim Meritt
>| ______________________________ Reply Separator
>| Subject: Watchdog
>| Author: "S.Ramalingam" <srm @
net> at SMTPINET
>| Date: 3/18/96 4:34 AM
>| Please let me know,
>| How to automatically logout the user(s) from systems (
>| from the shell ), if
>| he or she does not use the system for specified period,
>| say 15 minutes.