Saving TTY settings

I have 4 digi etherlite boards that allow Wyse and VT100 terminals to connect to our network (stop laughing) :slight_smile:

We are switching from an older version of redhat where we have these running to: Red Hat Enterprise Linux Server release 6.5 (Santiago)

I finally got them working and copied the tty settings from the old machine to a file and then loaded them in to the new machine:

Saved via:

 stty --save /dev/ttya00 $i > /home/shared/IT/tty/ttya0

Then loaded on new machine with

 stty -F /dev/ttya0 `cat /home/shared/IT/tty/ttya0`

and this works fine.

The problem is that on the old machine I turned everything on via inittab (example below)

a0:2345:respawn:/sbin/agetty  19200 ttya00
a1:2345:respawn:/sbin/agetty  19200 ttya01
a2:2345:respawn:/sbin/agetty  19200 ttya02

I have no idea how to do this under the new version.

Like I said I have it working but it's not right

in my /etc/rc.d/rc.local i have things like this:

start tty TTY=/dev/ttya00
start tty TTY=/dev/ttya01
start tty TTY=/dev/ttya02
start tty TTY=/dev/ttya03
start tty TTY=/dev/ttya04
start tty TTY=/dev/ttya05

stty -F /dev/ttya0 `cat /home/shared/IT/tty/ttya0`
stty -F /dev/ttya1 `cat /home/shared/IT/tty/ttya1`
stty -F /dev/ttya2 `cat /home/shared/IT/tty/ttya2`
stty -F /dev/ttya3 `cat /home/shared/IT/tty/ttya3`
stty -F /dev/ttya4 `cat /home/shared/IT/tty/ttya4`

So my question is:

a) how do i save my settings so i don't have to load them each time?
b) how do i do something similiar to inittab to specify which tty's I want agetty/mgetty running on?

Thanks!

Why not specify the options you actually want, instead of loading from save all the time?

Corona

I just want to be able to reboot and not have to reload them again.

and also not have to use "start tty" on each port (16 ports * 4 terminal servers)

They have to come from somewhere. /etc/inittab is a decent place for them if you know the options you want.

stty appears to understand them if you just give it as arguments:

$ stty save
500:5:bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

$ stty 500:5:bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
$

you can't put them inittab under RedHat EL 6.5, as I understand

it says:

# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#

yeah this seems to be an Upstart issue, which I'm not totally familiar with, but i booted into a CentOS VM and poked around /etc/init.

It seems start-ttys.conf works by iterating over ACTIVE_CONSOLES and starting new jobs like you do ( start tty TTY=... ). So I'd probably add to ACTIVE_CONSOLES ( ACTIVE_CONSOLES=/dev/tty[1-6] /dev/ttya0[0-5] ), and create a tty.override which does something like:

# load saved tty config if one exists
pre-start script
  [ -f "/home/shared/IT/tty/$TTY" ] && stty -F "/dev/$TTY" < "/home/shared/IT/tty/$TTY"
end script