Solved

mgetty not answering the phone.

Posted on 1998-09-20
10
731 Views
Last Modified: 2013-12-15
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
Comment
Question by:joe_massimino
  • 5
  • 3
  • 2
10 Comments
 
LVL 2

Expert Comment

by:JYoungman
ID: 1630829
Did you put the modem in auto-answer mode with the "ATA" command?

0
 
LVL 6

Author Comment

by:joe_massimino
ID: 1630830
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
 
LVL 6

Author Comment

by:joe_massimino
ID: 1630831
Adjusted points to 75
0
 
LVL 2

Expert Comment

by:JYoungman
ID: 1630832
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
 
LVL 3

Expert Comment

by:marcelofr
ID: 1630833
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 6

Author Comment

by:joe_massimino
ID: 1630834
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
 
LVL 6

Author Comment

by:joe_massimino
ID: 1630835
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
 
LVL 3

Accepted Solution

by:
marcelofr earned 70 total points
ID: 1630836
ttyS0

the uppercase "S" is not a print error ;-)
0
 
LVL 2

Expert Comment

by:JYoungman
ID: 1630837
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
 
LVL 6

Author Comment

by:joe_massimino
ID: 1630838
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now