mgetty won't see the modem after the first call

Eric Veldhuyzen (eric@terra.telemediair.nl)
Mon, 18 Oct 1999 10:15:50 +0200


Hello,

Since I didn't get any answer the last time I asked this question,
I try another time, this time with some additional information.

I hope that someone can give me at least some hint so that I know where
to look for the solution to my problem. I should have this system up
and running a week ago now and I still haven't got it working so I
am getting pretty desparate. If you know ANYTHING that might help me,
please let me know.

What I want to do is create a simple, very basic dialin server which
boots from a floppy disk (linux, kernel 2.0.38) and get it's network
configuration via bootp. The only function is to let users dialin via
PPP (chap) or a terminal session (only for me, for administration in
emergencies). So, this floppy is quite limited in functionality, it
only contains the things it absolutly has to. This might be a problem,
but none of the programs is complaining about anything.

All of this works (with mgetty 1.1.21-Jul24), but after either the
terminal session or the PPP session is closed there won't be any logins
possible on this port anymore.  On bootup I can see the DTR light going
on, and mgetty works. After the first call this light goes off, metty
is restarted by init but the lockfile is not removed and mgetty doesn't
do anything with the port (or at least nothing that it is telling me
through the logs). The modem is a Cyber Bullet E56K RVP, which can do
data, FAX en voice.

Here the configuration files and logs:

mgetty.config:
-------------------
debug 9
speed 115200
data-only y
-------------------

login.config:
-------------------
/AutoPPP/       -       @       /sbin/pppd
-------------------

inittab:
-------------------
S0:1:respawn:/bin/mgetty ttyS0
S1:1:respawn:/bin/mgetty ttyS1
-------------------

mgetty log:
-------------------
Oct 13 09:57:50 sde0 logger: 10/13 09:55:34 yS1  waiting...  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1    select returned 1  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1   checking lockfiles, locking the line  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1   makelock(ttyS1) called  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1   do_makelock: lock='/var/lock/LCK..ttyS1'  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1   lock made  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1  wfr: waiting for ``RING''  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1   got: [0d][0a]RING[0d]  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1    CND: RING  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1   wfr: rc=0, drn=0  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1  send: ATA[0d]  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1  waiting for ``CONNECT''  
Oct 13 09:57:50 sde0 logger: 10/13 00:57:50 yS1   got: ATA[0d]  
Oct 13 09:58:04 sde0 logger: 10/13 00:57:50 yS1    CND: OKATA[0d][0a]CONNECT ** found **  
Oct 13 09:58:04 sde0 logger: 10/13 00:58:04 yS1  send:   
Oct 13 09:58:04 sde0 logger: 10/13 00:58:04 yS1  waiting for ``_''  
Oct 13 09:58:04 sde0 logger: 10/13 00:58:04 yS1   got:  28800/V42[0d]  
Oct 13 09:58:04 sde0 logger: 10/13 00:58:04 yS1    CND: CONNECT 28800/V42  
Oct 13 09:58:04 sde0 logger: 10/13 00:58:04 yS1    CND: found: 28800/V42[0a] ** found **  
Oct 13 09:58:05 sde0 logger: 10/13 00:58:04 yS1   waiting for line to clear (VTIME), read:   
Oct 13 09:58:05 sde0 logger: 10/13 00:58:05 yS1    looking for utmp entry... (my PID: 25)  
Oct 13 09:58:05 sde0 logger: 10/13 00:58:05 yS1   utmp + wtmp entry made  
Oct 13 09:58:05 sde0 logger: 10/13 00:58:05 yS1   tio_set_flow_control( HARD )  
Oct 13 09:58:05 sde0 logger: 10/13 00:58:05 yS1   print welcome banner (/etc/issue)  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:05 yS1   getlogname (AUTO_PPP), read:eric[0d]  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 yS1   input finished with '\r', setting ICRNL ONLCR  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 yS1   tio_get_rs232_lines: status: RTS CTS DSR DTR DCD  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 yS1    login: use login config file /etc/mgetty+sendfax/login.config  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 yS1   match: user='eric', key='/AutoPPP/'  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 yS1   login: fall back to /bin/login  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 yS1   calling login: cmd='/bin/login', argv[]='login eric'  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 ##### data dev=ttyS1, pid=25, caller='none', conn='28800/V42', name='', cmd='/bin/login', user='eric'  
Oct 13 09:58:12 sde0 logger:   
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 yS1   setenv: 'CALLER_ID=none'  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 yS1   setenv: 'CALLED_ID='  
Oct 13 09:58:12 sde0 logger: 10/13 00:58:12 yS1   setenv: 'CONNECT=28800/V42' 
Oct 13 09:58:12 sde0 mgetty[25]: data dev=ttyS1, pid=25, caller='none', conn='28800/V42', name='', cmd='/bin/login', user='eric' 
Oct 13 09:58:16 sde0 PAM_pwdb[25]: (login) session opened for user eric by (uid=0) 
Oct 13 09:58:16 sde0 login -- eric [25]: DIALUP AT ttyS1 BY eric 
Oct 13 09:58:16 sde0 login -- eric [25]: LOGIN ON ttyS1 BY eric 
Oct 13 09:58:16 sde0 PAM_pwdb[25]: (login) session closed for user eric 
-------------------

Here the log stops. A new mgetty is started by init though. Removing
the lock file, turning the modem off/on, and killing mgetty to force a
reinitialization doesn't have any effect.

My version of the policy.h (removed comments to limit the size of
this mail a bit):
-------------------
#define MGETTY_CONFIG "mgetty.config"
#define SENDFAX_CONFIG "sendfax.config"
#define LOGIN_CFG_FILE "login.config"
#define DEFAULT_LOGIN_PROGRAM "/bin/login"
#define CALLBACK_CONFIG "callback.config"
/* #define CNDFILE "dialin.config" */
/* #define USE_GETTYDEFS */
#define GETTYDEFS "/etc/gettydefs"
#define GETTYDEFS_DEFAULT_TAG "n"
#define DEVICE_OWNER	"root"
#define DEVICE_GROUP	"root"
#define FILE_MODE 0660
/* #define EXEC_FUSER "exec fuser -k -f %s >/dev/null 2>&1" */
#define CONSOLE "/dev/tty2"
#define LOG_PATH "/var/log/mgetty.%s"
#define LOG_LEVEL L_MESG
/* #define LOG_CR_NEWLINE */
#define ADMIN	"root"
#define SYSLOG
#define SYSLOG_FC LOG_AUTH
/* #define SYSTEM	"greenie" */
#define LOGIN_PROMPT	"@!login: "
/* #define ENV_TTYPROMPT */
/* #define DO_LCUC_MAP */
#define MAX_LOGIN_TIME	240
#define NOLOGIN_FILE "/etc/nologin.%s"
#define MGETTY_PID_FILE	"/var/run/mg-pid.%s"
#  define LOCK	"/var/lock/LCK..%s"
#define LOCKS_BINARY 0
/* #define LOCKS_LOWERCASE */
#define DEFAULT_PORTSPEED	38400
#define MODEM_INIT_STRING	"ATS0=0Q0&D3&C1"
#define MODEM_CMD_SUFFIX "\r"
#define MODEM_CHECK_TIME 3600
#define DEFAULT_MODEMTYPE "auto"
#define DO_CHAT_SEND_DELAY 50
#define FAX_COMMAND_DELAY 50
#define FAX_IN_OWNER	"root"
/* #define FAX_IN_GROUP	"root" */
#define FAX_FILE_MODE 0660
#define DATA_FLOW	FLOW_HARD
#define FAXREC_FLOW	FLOW_HARD | FLOW_SOFT
#define FAXSEND_FLOW	FLOW_HARD | FLOW_SOFT
/* #define FAX_RECV_SWITCHBD 19200 */
/* #define FAX_USRobotics */
#define FAX_LOG		"/var/log/sendfax.log"
#define FAX_STATION_ID	"49 115 xxxxxxxx"
#define FAX_SEND_BAUD 38400
/* #define FAX_SEND_SWITCHBD 19200 */
/* #define FAX_MODEM_HANDSHAKE "AT&H3" */
#define FAX_DIAL_PREFIX "ATD"
#define FAX_SEND_MAX_TRIES 3
#define FAX_MODEM_TTYS	"tty4c:tty4d"
# define MAILER		"/usr/lib/sendmail"
# define NEED_MAIL_HEADERS
#define MAIL_TO		"faxadmin"
#define FAX_NOTIFY_PROGRAM "/usr/local/lib/mgetty+sendfax/new_fax"
#define	MINFREESPACE 1024
-------------------

-- 
#!perl #                       Life ain't fair, but root passwords help.
# Eric Veldhuyzen                              eric@terra.telemediair.nl
$!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~                   # Perl Monger
/.(.)...(.)(.)....(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_>&$;`