[u3b.misc] Info-3b2 Digest, Number 83

kdavis@lamc.UUCP (Ken Davis) (05/19/89)

 
                           Info-3b2 Digest, Number 83
 
                            Thursday, May 18th 1989
 
Today's Topics:
 
                                   idledaemon
                                 Re: idledaemon 
----------------------------------------------------------------------
 
Subject: idledaemon
From: info-3b2@netsys.COM
Date: Wed, 17 May 89 23:47:59 -0400

Date: Wed, 17 May 89 19:03:13 PDT
From: Ken Davis       <kdavis@lamc>

I am searching for an idledaemon program that will politely log
off dialin users when a certain time of inactivity occurrs.  I
have seen several that were written for Berkeley but haven't run
into one that would run on the 3b2.

Thanks.
  Ken

--
Ken Davis - W6RFN      San Francisco, California
UUCP: (apple, pyramid, netsys, pacbell, hoptoad}!lamc!kdavis
MILNET: kdavis@pentagon-opti.army.mil      DIALCOM: 164:MDU0116

------------------------------
 
Subject: Re: idledaemon 
From: info-3b2@netsys.COM
Date: Thu, 18 May 89 13:14:08 -0400

Date: 18 May 89 09:50:45 CDT (Thu)
From: rjn@woton.UUCP

>> Date: Wed, 17 May 89 19:03:13 PDT
>> From: Ken Davis       <kdavis@lamc>
>> 
>> I am searching for an idledaemon program that will politely log
>> off dialin users when a certain time of inactivity occurrs.  I
>> have seen several that were written for Berkeley but haven't run
>> into one that would run on the 3b2.
>> 
>> Thanks.
>>   Ken
>> 
>> --
>> Ken Davis - W6RFN      San Francisco, California
>> UUCP: (apple, pyramid, netsys, pacbell, hoptoad}!lamc!kdavis
>> MILNET: kdavis@pentagon-opti.army.mil      DIALCOM: 164:MDU0116
>> 
Well here is one that is not as polite as it could be but it is what
we use here on our 3bXX machines, including a 3b2/310 and a 3b2/600.
If this dosen't work for you I hope it will give you a place to build
your own from.   If you find a better one would you please send me a 
copy of it.  Rj.

	R.J. Nichols - Galveston, Texas
	UUCP: rjn@woton or { cs.utexas.edu, uhnix1 }!woton!rjn

           \\\!/// 
            _   _             They're out there and there comming to get me!!!!
          ( Q   Q ) 
---,,,,-------U-------,,,,--- 

---------------------------------< cut here >---------------------------------
#	killer.sh -- inactive login killer
#
#  This script kills any user logins that have had no activity for a
#  given period of time ($TIMELIMIT).  This script should be run
#  periodically by a line in crontab, e.g.:
#
#	0,10,20,30,40,50 * * * * sh /bin/special/killer
#
#  Note that if is run a ten-minute intervals it will add a possible extra
#  10 minutes to the time allowed by $TIMELIMIT.
#
#  History:
#  86.07.09  ???	Prehistoric version.
#  86.08.15  rjn	Moved log file to /bin/special/killog , 
#			and added comments
#  86.10.21  riddle	Increased TIMELIMIT to maximum.
#  87.03.12  riddle	Exempted uucp and lp processes from being killed.
#
KILLOG=/bin/special/killog
TEMP=/tmp/killer$$
TIMELIMIT=49			# Must not exceed 49!!
#
who -u | grep -v root | grep -v uucp | grep -v lp | cut -c40-49 | tr -s " " | tr " " "|" > $TEMP
for ENTRY in `cat $TEMP`
do
if [ `echo $ENTRY | cut -c1` = ":" ]
   then TIME=`echo $ENTRY | cut -c2-3`
   else TIME=0
fi
if [ $TIME -ge $TIMELIMIT ]
   then PROC=`echo $ENTRY | cut -d"|" -f2`
        USER=`who -u | grep $PROC | cut -c1-8`
        kill -9 $PROC
        echo "`date '+%D  %H:%M'`    $USER $PROC" >> $KILLOG
   else continue
fi
done
/bin/rm -f $TEMP

# EOF

 
-------------------------------------
 
To join this group or have your thoughts in the next issue, please
send electronic mail to Ken Davis at the following address;

    {apple, netsys, pacbell, pyramid}!lamc!info-3b2-digest
 
The views expressed in Info-3b2 Digest are those of the 
individual authors only.
 
**********************
End of Info-3b2 Digest
**********************