Subject: Re: mgetty problem
To: Matteo Arosti - Sir s.r.l. <matteo.arosti@sirpesaro.it>
From: David Wetzel <dave@turbocat.de>
List: netbsd-help
Date: 08/28/2001 18:49:42
matteo.arosti@sirpesaro.it wrote:

> Sorry, I found in Internet your e-mail where you spoke about your problem with
> mgetty. Now I have the same problem (I think) .... can you help
> me?
> 
> -----------------------------------------------------------------------------------------
> this is you e-mail:
> 
> Any idea? I am using NetBSD 1.5.1 and an ZxYEL
> 
> alice# tail -f /var/log/mgetty.tty02
(....)
> 07/24 17:05:55 y02  found action string: ``NO CARRIER''
> 07/24 17:05:55 ##### failed A FAIL dev=tty02, pid=25892, caller='none', conn='', name=''
> 
> 07/24 17:05:55 y02   removing lock file
> (HERE DOES mgetty EXIT)
> 
> Any ideas? 
> Dave

dave@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

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

add this to your crontab:

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

---
   _  _
 _(_)(_)_  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

>> Send by TCWebMail http://www.turbocat.de/products/