[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

8140.0. "ppp "inactivity_timeout" usage" by TAV02::JEREMY () Tue Dec 10 1996 11:04

T.RTitleUserPersonal
Name
DateLines
8140.1not sure how to do this...NETRIX::"[email protected]"Farrell WoodsWed Dec 11 1996 11:0015
8140.2TAV02::JEREMYThu Dec 12 1996 04:042
8140.3Still lookingTAV02::JEREMYTue Feb 11 1997 09:4339
    
    The question of inactivity timeout for PPP sessions has arisen again.
    The following script is what they used under SunOS, which doesn't
    work under DU. Does anyone have a script or another solution that will
    provide the desired functionality?
    
    # !/bin/sh
    # Check and kill the inactive pppd lines
    
    # Remove old tmp files
    [ `date '+%H'` -eq 6 ] && (cd /tmp; find . -name "x29*" -atime 1 -exec
    rm {} \;)
    
    pids=`/bin/ps -a|/bin/grep x29|/bin/grep -v grep|grep -v yaron|/bin/awk
    '{print$1}'`
    for pid in `echo $pids`
    do
            if [ -f /tmp/x29.$pid ]
            then
                    old_rcv=`/bin/cat /tmp/x29.$pid`
            else
                    old_rcv=0
            fi
            new_rcv=`/usr/etc/pstat -u $pid | /bin/grep msgsnd | /bin/awk
    '$8> 0 {print
    $8}'`
            diff_rcv=`/bin/expr $new_rcv - $old_rcv`
            if [ "$diff_rcv" -gt "0" ]
            then
                    /bin/echo $new_rcv >/tmp/x29.$pid
            else
                    in_line=`/bin/ps $pid|/bin/grep -v PID|/bin/awk '{print
    $2}'`
                    /usr/etc/fuser -ku /dev/tty$in_line
            fi
    done