Linux getty-ps mini-HOWTO (part 1/1)

Linux getty-ps mini-HOWTO (part 1/1)

Post by Mark Horto » Fri, 01 Dec 1995 04:00:00



Archive-name: linux/howto/mini/getty-ps
Last-modified: 6 Sep 94

-----BEGIN PGP SIGNED MESSAGE-----

*** The `Linux getty-ps mini-HOWTO' is posted automatically by the
*** Linux HOWTO coordinator, Greg Hankins <gr...@sunsite.unc.edu>.  Please
*** direct any comments or questions about this HOWTO to the author,
*** Mark Horton <m...@ka4ybr.com>.

- --- BEGIN Linux getty-ps mini-HOWTO part 1/1 ---

Mini getty_ps-HOWTO

        by Mark Horton  m...@ka4ybr.com, m...@ka4ybr.atl.ga.us

OK, this seems to keep cropping up and I'm getting tired of
emailing what works for me and serial lines and getty and
uugetty (sorry about all the ands :) above !) so I'm posting
this to c.o.l.help instead.  IMHO, mgetty+sendfax is a very
nice package if you want to doitall with a single modem
line.  However, to create a getty/uugetty situation which
serves dial-up lines, uucp in and outbound, and serial local
devices, the getty_ps package (again IMHO) is an excellent  
way to go.

The suggestions below work on my systems and have, in one form
or another, worked for almost two years of my Linux experiences.
The fact that they work for me does NOT mean they are guaranteed
to work for you.... I hope they do and make your life easier...
if not, please accept my apologies and condolences.  If you
have any suggestions or improvements to these procedures,
(other than "Stuff it up your $#@(%^") please contact me.  If
you have questions about them and/or problems in getting your
setup to work, please feel free to email me... I will try to
answer any questions I can, but please give me a little more
than "It don't work!" to go on... :)
                -- Mark

So, all verbage and b.s. aside, here's my "cookbook" configuration:

0.      a. Get getty_ps-2.0.7e from sunsite.unc.edu
        b. Decide if you want to use the new FSSTND or not.
           (This from the Makefile) :
# FSSTND Compliance:
#   If you want getty_ps to comply with the upcoming FSSTND document,
#   uncomment the following line.  As a result, all config files will
#   be expected in /etc/conf.* rather than /etc/default, modem locks
#   will be created in /var/lock, and binaries will go in /sbin.
#
# FSSTND=-DFSSTND
           I commented it out since I'm a curmudgeon and LIKE my defaults
           in /etc/default (and couldn't figure out if the formats were
           the same for the /etc/conf.* format... I admit it, I'm lazy)
           I also didn't want to mess with Taylor and wanted my locks
           left in /usr/spool/uucp.  You will also note in the following
           examples that I have violated the rules and put my executables
           for getty and uugetty in /etc.... if you don't like it, put
           them in /sbin or /bin if it pleases you... it's YOUR system!
        c. READ the README.linux file to figure out where you want things
           and how you want to proceed!!!!!!!!!!!!!!!!!!!
        d. "make" and "make install"
        e. Move getty and uugetty to where you want them. (I like /etc)
        f. Make changes to /etc/inittab, /etc/gettydefs (or use defaults
           in the distribution subdirectory Examples - I highly recommend
           this!  It helps you avoid oversites like forgetting the INITLINE
           parameter for manual (program) answering and wondering why the
           modems just ring... and ring.... and ring....)  *blush*
        g. Move the examples to /etc/default if you use that configuration
           or figure out what they look like with the new FSSTND config. and
           put them there.
        h. Hack the uugetty.ttyS? and getty.ttyS? entries as desired (my
           sample uugetty.ttyS? is below.)
        i. Change your /etc/rc.d/rc.serial as desired for your ports -
           remember - you have to do this even with the standard ports!
           Make sure it gets executed on startup (a safe place to put it
           is in rc.local! :)  NOTE: if you have a serial rodent and use
           the selection package, be sure to execute rc.serial PRIOR to
           starting up selection!
        j. Make the necessary changes to the uucp files Systems, Dialers,
           Devices, and Permissions.
        k. Shutdown and reboot with the new getty.  Have your boot diskettes
           handy in case of finger-checks... init is not too kind about errors
           in /etc/inittab!
        l. try dialing out on one of your uucp lines (I like to use "cu -d" for
           this so I can see that all is working as planned) and adjust as
           necessary.  
        m. For nasty problems, use the -D777 flag in /etc/inittab for the
           lines in question to figure out what's going on... REMEMBER to
           change it back after all is clean or you'll be burning up disk
           space at a furious rate!

1.      /etc/rc.d/rc.serial :   (I use 2 STB-4COM cards)
                (yours WILL most likely be different - read the man page!)
#
# /etc/rc.serial
#       Initializes the serial ports on your system
#
#       Version 2.01

cd /dev

SETSERIAL="/bin/setserial -b"
PORTS=`echo cua?`

echo -n "Configuring serial ports...."

# Do wild interrupt detection
#
${SETSERIAL} -W ${PORTS}

#
# MANUAL CONFIGURATION
#
${SETSERIAL} /dev/cua0 -- uart 16550A port 0x3f8 irq 4 -fourport
${SETSERIAL} /dev/cua1 -- uart 16550A port 0x2f8 irq 4 -fourport
${SETSERIAL} /dev/cua2 -- uart 16550A port 0x3e8 irq 4 -fourport
${SETSERIAL} /dev/cua3 -- uart 16550A port 0x2e8 irq 4 -fourport
${SETSERIAL} /dev/cua4 -- uart 16550A port 0x1f8 irq 3 -fourport
${SETSERIAL} /dev/cua5 -- uart 16550A port 0x1e8 irq 3 -fourport
${SETSERIAL} /dev/cua6 -- uart 16550A port 0x2a8 irq 3 -fourport
${SETSERIAL} /dev/cua7 -- uart 16550A port 0x1a8 irq 3 -fourport
#
###########################################################
#
# Print the results of the serial configuration process
#
###########################################################

echo "done."

${SETSERIAL} -bg ${PORTS}

2.      /etc/gettydefs  (pretty much what comes with getty_ps):
# [ put this file in /etc/gettydefs ]
#
# This file contains the startup and final flags for the
# tty lines.  Each line starts with a SPEED value; this is
# the same SPEED that you pass to [uu]getty.  Note that the
# SPEED identifier is just a string; use whatever names
# you want.
#
# The blank lines in this file are important (so I hear).
#
# The flags are the same flags you would pass to the stty
# program.
#
# Format: <speed># <init flags> # <final flags> #<login string>#<next-speed>
#
#
# Virtual Console entry
VC# B38400 SANE CLOCAL # B38400 SANE -ISTRIP CLOCAL #@S login: #VC

# 38400 fixed baud Dumb Terminal entry
DT38400# B38400 CS8 CLOCAL CRTSCTS # B38400 SANE -ISTRIP CLOCAL CRTSCTS #@S login: #DT38400

# 19200 fixed baud Dumb Terminal entry
DT19200# B19200 CS8 CLOCAL # B19200 SANE -ISTRIP CLOCAL #@S login: #DT19200

# 9600 baud Dumb Terminal entry
DT9600# B9600 CS8 CLOCAL # B9600 SANE -ISTRIP CLOCAL #@S login: #DT9600

# 38400 fixed-baud modem entry
F38400# B38400 CS8 # B38400 SANE -ISTRIP HUPCL #@S login: #F38400

# 19200 fixed-baud modem entry
F19200# B19200 CS8 CRTSCTS # B19200 SANE -ISTRIP HUPCL CRTSCTS #@S login: #F19200

# 9600 fixed-baud modem entry
F9600# B9600 CS8 # B9600 SANE -ISTRIP HUPCL #@S login: #F9600

# 38400 autobauding Modem entry with hard flow control
38400# B38400 CS8 CRTSCTS # B38400 SANE -ISTRIP HUPCL CRTSCTS #@S login: #38400

19200# B19200 CS8 CRTSCTS # B19200 SANE -ISTRIP HUPCL CRTSCTS #@S login: #19200

9600# B9600 CS8 CRTSCTS # B9600 SANE -ISTRIP HUPCL CRTSCTS #@S login: #9600

2400# B2400 CS8 CRTSCTS # B2400 SANE -ISTRIP HUPCL CRTSCTS #@S login: #2400

1200# B1200 CS8 CRTSCTS # B1200 SANE -ISTRIP HUPCL CRTSCTS #@S login: #1200

300# B300 CS8 CRTSCTS # B300 SANE -ISTRIP HUPCL CRTSCTS #@S login: #300  

3.      /etc/inittab    (modified per getty_ps documentation) :
#
# inittab       This file describes how the INIT process should set up
#               the system in a certain run-level.
#
# Version:      @(#)inittab             2.04    17/05/93        MvS
#
# Author:       Miquel van Smoorenburg, <miqu...@drinkel.nl.mugnet.org>
#
# Default runlevel.
id:5:initdefault:

# System initialization (runs when system boots).
si:S:sysinit:/etc/rc.d/rc.S

# Script to run when going single user.
su:S:wait:/etc/rc.d/rc.K

# Script to run when going multi user.
rc:123456:wait:/etc/rc.d/rc.M

# What to do at the "Three Finger Salute".
ca::ctrlaltdel:/sbin/shutdown -t3 -rf now

# What to do when power fails (shutdown to single user).
pf::powerfail:/sbin/shutdown -f +5 "THE POWER IS FAILING"

# If power is back before shutdown, cancel the running shutdown.
pg:0123456:powerokwait:/sbin/shutdown -c "THE POWER IS BACK"

# If power comes back in single user mode, return to multi user mode.
ps:S:powerokwait:/sbin/init 5

# The getties in multi user mode on consoles an serial lines.
#
# NOTE NOTE NOTE adjust this to your getty or you will not be
#                able to login !!
#
# Note: for 'agetty' you use linespeed, line.
# for 'getty_ps' you use line, linespeed and also use 'gettydefs'
c1:12345:respawn:/etc/getty tty1 VC
c2:12345:respawn:/etc/getty tty2 VC
c3:45:respawn:/etc/getty tty3 VC
c4:45:respawn:/etc/getty tty4 VC
c5:45:respawn:/etc/getty tty5 VC
c6:45:respawn:/etc/getty tty6 VC
c7:45:respawn:/etc/getty tty7 VC
c8:45:respawn:/etc/getty tty8 VC
c9:45:respawn:/etc/getty tty9 VC
cx:45:respawn:/etc/getty tty10 VC
cy:45:respawn:/etc/getty tty11 VC
# cz:456:respawn:/etc/getty tty12 VC

# Serial lines
#       To turn on debugging insert the -Dnnn parameter ex.:
#       s3:45:respawn:/etc/uugetty -D777 ttyS3 F19200 vt100
#       Debug levels:   (from getty.h)
# define D_OPT   0001            /* option settings */
# define D_DEF   0002            /* defaults file processing */
# define D_UTMP  0004            /* utmp/wtmp processing */
# define D_INIT  0010            /* line initialization (INIT) */
# define D_GTAB  0020            /* gettytab file processing */
# define D_RUN   0040            /* other runtime diagnostics */
# define D_RB    0100            /* ringback debugging */
# define D_LOCK  0200            /* uugetty lockfile processing */
# define D_SCH   0400            /* schedule processing */
# define D_ALL   0777            /* all priorities */
#

s0:45:respawn:/etc/getty ttyS0 DT9600
s1:45:respawn:/etc/getty ttyS1 DT9600
s2:45:respawn:/etc/getty ttyS2 DT9600
s3:45:respawn:/etc/uugetty ttyS3 19200 vt100
s4:45:respawn:/etc/uugetty ttyS4 19200 vt100
s5:45:respawn:/etc/getty ttyS5 DT9600
s6:45:respawn:/etc/uugetty ttyS6 19200 vt100
s7:45:respawn:/etc/getty ttyS7 DT9600

# Runlevel 6 used to be for an X-window only system, until we discovered
# that it throws init into a loop that keeps your load avg at least 1 all
# the time. Thus, there is now one getty opened on tty6. Hopefully no one
# will notice. ;^)
# It might not be bad to have one text console anyway, in case something
# happens to X.
x1:6:wait:/etc/rc.d/rc.6

# End of /etc/inittab

4.      /etc/default/uugetty.ttyS4      (a sample)
        [note: the init string is for DSI Scout+ modems - yours WILL
        most likely be different!]

# sample uugetty configuration file for a Hayes compatible modem to allow
# incoming modem connections
#

# this config file sets up uugetty to answer with a WAITFOR string.  When
# using waitfor, it is necessary to specify INITLINE=cua?

ISSUE=/etc/issue

LOGIN=/bin/login

# line to use to do initialization.  All INIT, OFF, and WAITFOR functions
# are handled on this line.  If this line is not specified, any other
# program that wants to share the line (like kermit, uucp, seyon) will
# fail.  This line will also be checked for lockfiles.
#
# format: <line> (without the /dev/)
INITLINE=cua4

# timeout to disconnect if idle...
TIMEOUT=60

# modem initialization string... Sets the modem to disable auto-answer
#
# format: <expect> <send> ... (chat sequence)
INIT="" \d+++\dAT\r OK\r\n ATH0\r OK\r\n AT\sM0\sE1\sQ0\sV1\sX4\sS0=0\s*S0\s*M0\s*T0\r OK\r\n

# waitfor string... if this sequence of characters is received over the line,
# a call is detected.
WAITFOR=RING

# this line is the connect chat sequence.  This chat sequence is performed
# after the WAITFOR string is found.  The \A character automatically sets
# the baudrate to the characters that are found, so if you get the message
# CONNECT 2400, the baud rate is set to 2400 baud.
#
# format: <expect> <send> ... (chat sequence)
CONNECT="" ATA\r CONNECT\s\A

# this line sets the time to delay before sending the login banner
DELAY=2

5.      /var/lib/uucp/hdb_config/Devices        (this is a Slackware dist.)
# Devices
#
# Everybody works at these speeds :
ACU cua3 - 9600 scout \D
ACU cua4 - 9600 scout \D
ACU cua6 - 9600 scout \D
#
ACU cua3 - 2400 scout \D
ACU cua4 - 2400 scout \D
ACU cua6 - 2400 scout \D
#
ACU cua3 - 38400 scout \D
ACU cua4 - 38400 scout \D
ACU cua6 - 38400 scout \D
#
# This one works - connect at 14400 in reality using v.32bis :
ACU cua4 - 19200 scout \D
ACU cua3 - 19200 scout \D
ACU cua6 - 19200 scout \D
#
#  This is to force a certain system to always use one line.
ACUX cua3 - 19200 scout \D
# ACUX cua4 - 19200 scout \D
# ACUX cua6 - 19200 scout \D

6.      /var/lib/uucp/hdb_config/Dialers        (this is a Slackware dist.)
        (please note the *E0 for no error correction, no compression... uucp
        does just fine by itself... use of anything other (in my experience)
        just slows things down!)
#
# Dialers - note the setup strings to set the TrailBlazer registers
#
scout   =W-,    "" A\pA\pA\pT\r OK \pAT&F\r OK \pATM0*Q0*T0*E0DP\T CONNECT
tbfast  =W-,    "" A\pA\pA\pT OK ATS50=255DP\T CONNECT\sFAST
tbslow  =W-,    "" A\pA\pA\pT OK ATS50=2DT\T CONNECT\s1200
tbmed   =W-,    "" A\pA\pA\pT OK ATS50=3DT\T CONNECT\s2400

7.      /var/lib/uucp/hdb_config/Systems        (this is a Slackware dist.)
        (please note that I've shortened this to just a few entries and removed
        secure information such a phone numbers and passwords.)  And before I
        get a lot of flak about the connect strings, let me say "Tough!" I want
        my connect sequences to blast through no matter what state the receiving
        modems are in!
# UUCP Systems file: System ka4ybr
asystem Any ACU 19200 nnnnnn1 "" \r ogin:-\K-ogin:-\K-ogin:-\K-ogin:-\K-ogin: \d\Euuka4ybr word: \dpassword
asystem Any ACU 19200 nnnnnn2 "" \r ogin:-\K-ogin:-\K-ogin:-\K-ogin:-\K-ogin: \d\Euuka4ybr word: \dpassword
bsystem Any ACU 9600 nnnnnn3 "" \r ogin:-\K-ogin:-\K-ogin:-\K-ogin:-\K-ogin: \d\Euuka4ybr\r word: \dpassword
csystem Any ACUX 19200 nnnnnn4 "" \r ogin:-\K-ogin:-\K-ogin:-\K-ogin:-\K-ogin: \d\Euuka4ybr\r word: \dpassword

8.      /var/lib/uucp/hdb_config/Permissions    (this is a Slackware dist.)
        LOGNAME=nuucp
        LOGNAME=uuv43test

MACHINE=asystem LOGNAME=uuasystem \
COMMANDS=/bin/rmail:/usr/bin/rsmtp:/usr/bin/smail:/usr/bin/uucp:/usr/local/lib/news/bin/rnews:/usr/bin/uux \
    READ=/var/spool/uucppublic:/usr/spool/uucppublic:/usr/tmp:/usr/local/lib:/var/spool/news:  \
    WRITE=/var/spool/uucppublic:/usr/spool/uucppublic:/usr/tmp:/usr/local/lib/news:/usr/spool/news:/var/spool/news \
    SENDFILES=yes REQUEST=yes

MACHINE=bsystem LOGNAME=uubsystem \
COMMANDS=/bin/rmail:/usr/bin/rsmtp:/usr/bin/smail:/usr/bin/uucp:/usr/local/lib/news/bin/rnews:/usr/bin/uux \
    READ=/var/spool/uucppublic:/usr/spool/uucppublic:/usr/tmp:/usr/local/lib:/var/spool/news:  \
    WRITE=/var/spool/uucppublic:/usr/spool/uucppublic:/usr/tmp:/usr/local/lib/news:/usr/spool/news:/var/spool/news \
    SENDFILES=yes REQUEST=yes

MACHINE=csystem LOGNAME=uucsystem \
COMMANDS=/bin/rmail:/usr/bin/rsmtp:/usr/bin/smail:/usr/bin/uucp:/usr/local/lib/news/bin/rnews:/usr/bin/uux \
    READ=/var/spool/uucppublic:/usr/spool/uucppublic:/usr/tmp:/usr/local/lib:/var/spool/news:  \
    WRITE=/var/spool/uucppublic:/usr/spool/uucppublic:/usr/tmp:/usr/local/lib/news:/usr/spool/news:/var/spool/news \
    SENDFILES=yes REQUEST=yes

9.      /etc/passwd entries     (samples)
uuasystem:6sEM8hx9x6efw:613:5:Node asystem:/var/spool/uucppublic:/usr/lib/uucp/uucico
uubsystem:6sEM8hx9x6efw:614:5:Node bsystem:/var/spool/uucppublic:/usr/lib/uucp/uucico
uucsystem:6sEM8hx9x6efw:615:5:Node csystem:/var/spool/uucppublic:/usr/lib/uucp/uucico

m...@ka4ybr.com 94/06/27

- --
"Linux!     Guerrilla UNIX Development     Venimus, Vidimus, Dolavimus."
- ------------------------------------------------------------
Mark A. Horton       ka4ybr             m...@ka4ybr.atl.ga.us
P.O. Box 747 Decatur GA US 30031-0747         m...@ka4ybr.com
+1.404.371.0291                     33 45 31 N / 084 16 59 W

- --- END Linux getty-ps mini-HOWTO part 1/1 ---

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: finger gr...@cc.gatech.edu for public key

iQCVAwUBML4zoHtNTo2suu5NAQHv3QP9E2DYjLKftiahKikcENjRiuU42cEf7r7s
BGpCobkm50tErmsHgLd5J9CBCdn74YvV9R8zw8+bkpQgkwyV4LmJbthVkrCi6qZY
1wrB7ip35sSLsSdj9fcoReAcBTWKlywxtvyvc/f02f2h8YGl/jQvwsSjxWqB6pcm
bLUyJdATvrU=
=dmGm
-----END PGP SIGNATURE-----