Link to home
Start Free TrialLog in
Avatar of mag062397
mag062397

asked on

mgetty doesn't respawn correctly

I'm using mgetty version 1.1.17-Aug07 on Redhat 5.1. (kernel 2.0.35) and I'm having trouble with mgetty answering the phone.

I have the following line in my /etc/inittab file:
S2:2345:respawn:/usr/local/sbin/mgetty -D ttyS2

And it answers fine for awhile and then just doesn't answer anymore until I reboot.  Example: I can call it right off the bat from a clean boot and hang up and then call back just fine.  However when I try back later that day (or night) it doesn't answer the phone.  

It still appears in the process table, but it doesn't answer the phone.

Where should I look for trying to trace this problem?  Log files?

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of marcelofr
marcelofr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mag062397
mag062397

ASKER

The -x 9 definitly gives more details.

I have also narrowed down the problem to this:  mgetty doesn't
reset itself correctly if it receives a voice call (a hang up
from a wrong number).  With the -x 9 option it just keep on logging to my /var/log/mgetty.ttyS2 log file until I killed the
process.  The log grow to about 500KB in a matter of just several
seconds.  It kept logging stuff like [98]f[98]...

It started with at getlogname (no opts), read:[06][fe]x[fd][98]... and so on and so on until I killed it.

Is there any way to get mgetty to timeout and RESET itself?
AFAIK you can't change it without recompiling (I have to look at the last sources... YES SOURCES...) RH versions always used 240 secs timeout to log in and then reset (put a dumb terminal and leave the login there... you'll see a warning and afterwards a reset with a messages...) Any way I see it's too long for you...
My version isn't even timing out after 24 hours.  It never times out once it goes into this state.  Once it logs getlogname (for a wrong number) it just hangs until I kill it.

Currently I did this (but I don't like it)... I created a simple cron job that wakes up every hour and checks to see if the modem is locked if it is it then checks to see if anyone is logged in using ttyS2 if not it waits 60 seconds and checks again (in case someone was in the process of logging in) if still noone is using ttyS2, the cron job then kills mgetty (which init then respawns correctly).
I think you must re-check your modem setup... mgetty doesn't hang up if it keeps getting characters from the modem, but where do this garbage come from? I think that your modem is echoing back the garbage to mgetty... have a look at the log and doble check your modem initialisation. Use init-chat if you need to...
Hmm.... that's sounds like a good guess.  The modem hangs up the line; however your right it does keep sending garbage or at least the mgetty keeps logging it.  Can you think of any setting that would cause the modem to keep sending stuff even after hanging up the line?  I'll look into the current settings and I'll also get out the manual.
what's your modem? If it were a usrobotics, load factory defaults 1 (at&f1) and you're done.
My modem is an MCT (basicly a no name brand).  I'll RTFM.
I think you have given me enough insight to track it down--Thanks!