Subject: Re: mgetty dies after dailin
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: David Wetzel <dave@turbocat.de>
List: netbsd-help
Date: 07/26/2001 22:58:38
Hi folks,

the "solution" is this script

alice# cat /usr/local/sbin/testmgetty.sh
#!/bin/sh

RUNNING=`ps ax | grep "/usr/pkg/sbin/mgetty tty02" |wc -l`

if [ $RUNNING -eq 1 ]; then
        #echo "all fine"
else
        #echo "no mgetty on tty02"
        if [ -f /var/spool/lock/LCK..tty02 ]; then
        #echo all fine someone uses the modem
        OTHERPID=`cat /var/spool/lock/LCK..tty02` 
        OTHERRUNNING=`ps ax | grep $OTHERPID | grep -v grep |wc -l`
                if [ $OTHERRUNNING -eq 1 ]; then
                #echo "all fine"
                else
                #remove logfile
                        rm /var/spool/lock/LCK..tty02
                 kill -HUP 1

                fi
        else
                kill -HUP 1
                #echo init got HUP
        fi
fi

#############

which is called via crontab:

*       *       *       *       *       /usr/local/sbin/testmgetty.sh

#############

I know that this is *VERY* ugly, but I found no other way to tell the system to run the getty after the modem hook off....

dave

---
   _  _
 _(_)(_)_  David Wetzel, Turbocat's Development,
(_) __ (_) Buchhorster Strasse 23, D-16567 Muehlenbeck/Berlin, FRG,
  _/  \_   Fax +49 33056 82835 Phone +49 33056 82834
 (______)  http://www.turbocat.de/  dave@turbocat.de
           DEVELOPMENT * CONSULTING * ADMINISTRATION