gettys & inittab

A getty is used to monitor the serial line and when a incomming call is
detected it passes the caller on to the appropriate program. There are two 
getty's that work well with ifmail, getty_ps and mgetty+sendfax-0.98. I use 
mgetty+sendfax because it handles both uucp and fido callers besides the 
usual human caller.

To use mgetty you will need to edit several of its config files, but the one
that is most important is login-config.dist file. Here is what my
/etc/mgetty-0.98/login-config.dist says:

# login.config
# This is a sample "login dispatcher" configuration file for mgetty
# Format:
#	username userid utmp_entry login_program [arguments]
# Meaning:
#       for a "username" entered at mgettys login: prompt, call
#	"login_program" with [arguments], with the uid set to "userid",
#	and a USER_PROCESS utmp entry with ut_user = "utmp_entry"
# username may be prefixed / suffixed by "*" (wildcard)
# userid is a valid user name from /etc/passwd, or "-" to not set
#  a login user id and keep the uid/euid root (needed for /bin/login)
# utmp_entry is what will appear in the "who" listing. Use "-" to not
#  set an utmp entry (a must for /bin/login), use "@" to set it to the
#  username entered. Maximum length is 8 characters.
# login_program is the program that will be exec()ed, with the arguments
#  passed in [arguments]. A "@" in the arguments will be replaced with the
#  username entered. Warning: if no "@" is given, the login_program has
#  no way to know what user name the user entered.
# Use this one with my Taylor-UUCP patch (taylor104.p1) and Taylor-UUCP
#  passwd files. (Big advantage: tuucp can use the same passwd file for
#  serial dial-in and tcp dial-in [uucico running as in.uucpd]).
#U*	uucp	@	/usr/lib/uucp/uucico -L @
# If you use Taylor UUCP 1.05, use that:
U*	uucp	@	/usr/lib/uucp/uucico -l -u @
# Use this one for fido calls (login name /FIDO/ is handled specially)
# You need Eugene Crosser's "ifmail" package for this to work.
# mgetty has to be compiled with "-DFIDO" in the options list, otherwise a 
# fido call won't  be detected.
/FIDO/	fnet	uucp	/usr/lib/ifmail/ifcico @
# An example where no login name in the argument list is desired:
#  automatically telnetting to machine "smarty" for a given login name
#telnet-smarty	gast	telnet	/usr/bin/telnet -8 smarty
# This is the "standard" behaviour - *dont* set a userid or utmp
#  entry here, otherwise /bin/login will fail!
#  This entry isn't really necessary: if it's missing, the built-in
#  default will do exactly this.
*	-	-	/bin/login @

If your using getty_ps don't forget to add #define FIDO in tune.h. You will 
also need to define a config file for the ttyS device your using. There are 
plenty of examples in /etc/default for uugetty and included in the archive. 
Here is what my /etc/default/uugetty.ttyS1 says:

INIT="" ATZS0=1\r OK

# Its very important to include these two lines. Otherwise fido callers
# will go undetected. Also some older versions of uugetty are case sensitive
# so watch for this in the example configs that accompanied your archive.  


Next you will need to add a line in your /etc/inittab file for your getty.
Here is what my /etc/inittab file:

# Serial lines
# This is my mgetty line for com port 2 .
s1:35:respawn:/usr/sbin/mgetty -D -s 38400 ttyS1 
# You can add this line instead if your using uugetty 
#s1:35:respawn:/sbin/uugetty -d /etc/default/uugetty.ttyS1 -t 180 ttyS1 38400

The first string is a label for the device. The second is the runlevel at 
which the program will take action. The third 'respawn:' causes the program 
to be restarted after it has terminated. The fourth is the path and name of 
the program to be executed and the rest of the line is the parameters needed 
to run the getty. For additional information try 'man inittab'.