[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 746
  • Last Modified:

mgetty not answering the phone.

I added the following line to my inittab file to get mgetty to answer on com1, known as cua0 on my Linux box.

 cua0:23:respawn:/usr/sbin/mgetty -x 3 tty7

I looked in ps -ax and see it loaded and (I guess) running, but it will not answer the phone.

Can someone give me a better way to get this to answer and let a user login via the modem?  
0
joe_massimino
Asked:
joe_massimino
  • 5
  • 3
  • 2
1 Solution
 
JYoungmanCommented:
Did you put the modem in auto-answer mode with the "ATA" command?

0
 
joe_massiminoAuthor Commented:
Would I do this on the above line by adding a switch?  I have three books on Linux, and none carry any details about mgetty. The man pages are fine if you are a Linux person, however, they were not written to help anyone learn linux, just to use if once you have learned it. I will try one more book on Linux, and then I guess I will have to lump myself through it. "If you don't like it, lump it"

I've read the man page, and the info page. they explain the switches, but offer no examples.
0
 
joe_massiminoAuthor Commented:
Adjusted points to 75
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
JYoungmanCommented:
Well, if you're new to all this, don't try to learn from the reference manual, learn from some tutorial material, for example the PPP-HOWTO, or the Red Hat Dialup-Tips document at http://www.redhat.com/support/docs/rhl/.

Connect to your modem with minicom.  Does it say "RING" when someone calls you?

0
 
marcelofrCommented:
increase -x to 9 and look at the debbuging in /var/log/log_mg.ttysomething...

And the device for com1 is ttyS0 not tty7 ;-)
0
 
joe_massiminoAuthor Commented:
I changed tty7 to ttyS0, and when the phone rings, minicom
reports RING. Still no answer.
Here is the last section of the log file, I see what's wrong, but will rely on an experts solution since I don't know my way around Linux yet.

 
09/22 17:51:07 ys0   key: 'answer-chat-timeout', type=0, flags=1, data=80
09/22 17:51:07 ys0   key: 'autobauding', type=3, flags=1, data=FALSE
09/22 17:51:07 ys0   key: 'ringback', type=3, flags=1, data=FALSE
09/22 17:51:07 ys0   key: 'ringback-time', type=0, flags=1, data=30
09/22 17:51:07 ys0   key: 'ignore-carrier', type=3, flags=1, data=FALSE
09/22 17:51:07 ys0   key: 'issue-file', type=1, flags=1, data=/etc/issue
09/22 17:51:07 ys0   key: 'prompt-waittime', type=0, flags=1, data=500
09/22 17:51:07 ys0   key: 'login-prompt', type=1, flags=1, data=login:
09/22 17:51:07 ys0   key: 'login-time', type=0, flags=1, data=240
09/22 17:51:07 ys0   key: 'fido-send-emsi', type=3, flags=1, data=TRUE
09/22 17:51:07 ys0   key: 'fax-id', type=1, flags=3, data=49 89 xxxxxxxx
09/22 17:51:07 ys0   key: 'fax-server-file', type=1, flags=0, data=(empty)
09/22 17:51:07 ys0   key: 'diskspace', type=0, flags=1, data=1024
09/22 17:51:07 ys0   key: 'notify', type=1, flags=1, data=faxadmin
09/22 17:51:07 ys0   key: 'fax-owner', type=1, flags=1, data=uucp
09/22 17:51:07 ys0   key: 'fax-group', type=1, flags=0, data=(empty)
09/22 17:51:07 ys0   key: 'fax-mode', type=0, flags=1, data=432
09/22 17:51:07 ys0   key: 'debug', type=0, flags=2, data=9
09/22 17:51:07 ys0   key: 'statistics-chat', type=2, flags=0, data=(empty)
09/22 17:51:07 ys0   key: 'statistics-file', type=1, flags=0, data=(empty)
09/22 17:51:07 ys0   key: 'gettydefs', type=1, flags=1, data=n
09/22 17:51:07 ys0   key: 'term', type=1, flags=0, data=(empty)
09/22 17:51:07 ys0  check for lockfiles
09/22 17:51:07 ys0   checklock: no active process has lock, will remove
09/22 17:51:07 ys0  locking the line
09/22 17:51:07 ys0   makelock(ttys0) called
09/22 17:51:07 ys0   do_makelock: lock='/var/lock/LCK..ttys0'
09/22 17:51:07 ys0   lock made
09/22 17:51:08 ys0  mod: cannot open line /dev/ttys0: Input/output error
09/22 17:51:08 ys0  open device /dev/ttys0 failed: Input/output error
09/22 17:51:08 ys0  cannot get terminal line dev=ttys0, exiting: Input/output error

0
 
joe_massiminoAuthor Commented:
I fixed this with the help of a ELUG "Everyones Linux Users Group" reply.

This is what fixed it in one try.  Does anyone object to the question getting deleted? If someone wants credit for helping me, I don't mind that either, but the reply below is what pulled me out of the dark on this.  I believe you guys would have gotten me there eventually.

Joe,
      You should call it d1 in the inittab.  This is just an identifier
to init and is really just to help you.  d1 is kind of a standard way of
saying dialup line #1.  The modem will actually be /dev/ttyS0 (you do not
want to use a cua for dialin only dialout.  The idea is to tell init to
fork off a mgetty process listening to /dev/ttyS0 and to respawn a new
mgetty if the first one dies.  The respawning too fast message means that
mgetty is dying with an error and after a few times init desides something
is wrong and disables "d1" for 5 minutes to give you a chance to fix the
problem.  This is necessary because if it respawned infinatley the computer
would basicly hang since processes spawned from init have top priority.
All you should need in the /etc/inittab file is:
d1:23:respawn:/sbin/mgetty ttyS0
this will give you a dialup on /dev/ttyS0 (COM1) in runlevels 2 and 3.

      You probobly already have something like this in inittab:
1:12345:respawn:/sbin/mingetty tty1
This is your first virtual console (alt-F1).  you probobly have 6 of theese
total.  /dev/tty's are your virtual consoles, /dev/ttyS's are serial ports,
and /dev/ttyp's and /dev/ttyq's are network (like an incomming telnet, rsh,
or an xterm).  You might also want to look at /etc/securetty.  This is a
list of tty's that are considered secure.  A secure tty means that a person
can login as root without su'ing.  /dev/tty and /dev/console should always
be listed in this file but you probobly don't want the network tty's listed
and you definately don't want dialups listed.  This way a hacker would have
to guess a userid, users password, and the root password in order to get in.



0
 
marcelofrCommented:
ttyS0

the uppercase "S" is not a print error ;-)
0
 
JYoungmanCommented:
Well, if you're still running minicom on that line, mgetty won't be able to send "ATA" to the modem to tell it to answer the phone when it sees the phone ring.

0
 
joe_massiminoAuthor Commented:
JYoungman, When using mgetty you do not need to tell the modem to answer the phone. The mgetty process monitors the modem for ringing and issues the command to answer. The modem needs to have the echo turned off, but other than that I didn't have to do anything else. Refer the the note I posted above, the person who sent that note to me had me working one minute after reading his comments.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now