[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Running two mgetty's on same line



On Mon, 21 Dec 1998, John Forest wrote:

> Tim Thomson wrote:
> > I have mgetty running on my modem from inittab and it answers after 10
> > rings, but I've set up xringd to dialup the internet and then run mgetty.
> > The second one complains about the first, and won't run.
> > 
> > I would take the mgetty out of the inittab, but then when the line is used
> > for ppp, it isn't logged in utmp, and I like this, because "sac dialout"
> > gives the total time for the month. Is there any other way to get such a
> > simple time log for dialup?

...

> I think I understand what you mean.  I set up mgetty and diald is now showing
> up in 'last'.
> Havent' tried yet, but maybe it is possible to set mgetty to debug 9 and make
> up a script simulating xringd.  I might be totally of the mark, but with a
> little timing that program/script could check for RING's in the logfile.
> Providing mgetty sends the RING's to the logfile of course.
> If that works, you don't have to run xringd and 'sac dialout' would work.

Hmmm, I haven't attempted this. What I did do was set up and inittab file
with mgetty and one without, and put them in /etc/inittab.mg and
/etc/inittab.nomg. Then I created /etc/mail.get which is an executable
script like this :

#! /bin/sh
echo 'Dialing...'
pppd call kapiti
sleep 60
echo 'Waiting till pppd off...'
while test -f /var/lock/LCK..ttyS3; do sleep 10; done
sleep 5
echo 'Switching off mgetty via inittab'
cp /etc/inittab.nomg /etc/inittab
kill -HUP 1
sleep 2
echo 'Waiting for call...'
mgetty -n 2 ttyS3
echo 'Modem Off, now turning mgetty back on'
sleep 2
cp /etc/inittab.mg /etc/inittab
kill -HUP 1
echo 'Done'

-------------
I have had a problem with this though. After dialling up, and getting mail
and stuff, it decided to shut down. But this is what happened:

Dec 25 17:59:20 tui pppd[31393]: Terminating connection due to lack of
activity.
Dec 25 17:59:28 tui pppd[31393]: write: Interrupted system call(4)
Dec 25 21:58:37 tui pppd[31393]: Hangup (SIGHUP)
Dec 25 21:58:38 tui pppd[31393]: Exit.

There is usually a "connection terminated" line in there, so I guess that
part may have been the one to be interrupted. I guess pppd thought it was
down, so wouldn't try again.

It was up for 4 hours (at NZ$2/hr), before hanging up properly!!! I'm not
sure if it was pppd finally timing out, or if my ISP did it automatically.

I guess xringd or mgetty may have caused the interrupted system call, but
I'm not sure how to fix it. I made the "sleep"s longer in /etc/mail.get to
what the are now, but it still does it. It doesn't do this every time,
usually only when there is a bit of traffic waiting.

Any ideas?

Thanks,

Tim.

-- 
ICQ #18073712                             http://members.xoom.com/thomson


Reply to: