[comp.sys.att] Hung out to dry.

dca@toylnd.UUCP (David C. Albrecht) (09/08/87)

I had forgotten about the problem with uucico getting hung by a
setgetty.  By the way you don't need to kill the uucico.  Just
nail the setgetty and the uucico will finish normally.  It always
gets nailed right when it is trying to close the line.  This is
a little shell script which I hacked up to deal with the problem.
I run it in cron on the half hour (on root) and generally it catches any
of the setgetty/uucico hangs and fixes them before I see them.

The crontab entry:

30 * * * * /bin/su root -c "/usr/local/bin/freeuucp > /dev/null"

The shell script (I call it freeuucp):

# uucico gets hung periodically when getty wakes up and decides to
# grab the line with a setgetty.  This file run by crontab peridocially
# will test the existance of a uucico and a setgetty on the same
# control terminal.  If so it will zap the setgetty.  Not 100% foolproof
# perhaps but close enough.
#
UUCS=`ps -e|fgrep uucico`
if [ -n "$UUCS" ]
then
    SETGET=`ps -e|fgrep setgetty`
    if [ -n "$SETGET" ]
    then
	set $UUCS
	UUCSTTY=$2
	set $SETGET
	if [ "$UUCSTTY" = "$2" ]
	then
	    kill $1
	fi
    fi
fi