Improve my FreeBSD serial terminal to FreeBSD headless config

I lost my notes from the last century in a flood in 2009 and I am getting old and cannot remember the specific details of how to do what I want to do. I am trying to setup one server with a keyboard and monitor to be the console for three other headless servers connected via RS-232c serial cables. I have managed to get it working where after booting the server with the monitor, I press Ctrl-Alt-F4, login, then run a script that uses cu to connect to one headless1 over a specific port (COM1). Then I press Ctrl-Alt-F5, login and run another script to connect to headless2 on COM2. Then Ctrl-Alt-F6, login and run script to connect with headless3 on COM3. This all relies on me being sufficiently disciplined to repeat this process after a reboot of the main server.

I would like to set this up so that three virtual terminals accessed by pressing F10, F11, F12, go straight to the serial attached server with getty selecting the correct COM port and setting the speed, parity and stop bits so that it works every time automatically after a reboot. Ideally, I could then use tmux with each headless connection.

I vaguely remember doing this on other systems many years ago using /etc/inittab and getty running ttyv9 on ttyS0 but I am not sure how to do this on FreeBSD. I am certain I have to use a cua device for outbound access to the headless terminals as I am already using cua in my scripts with cu. I reckon this probably has to be done in /etc/ttys perhaps with std.115200 and ttyv9, ttyva, ttyvb, but it would be nice to have a known working config to start from. Can anyone help?
 
Might seem a daft question but now that ethernet LANs are so cheap... why not just connect them up using ethernet and have done with it? Then you can run sshd on the server and connect to it using ssh.
You can get a cheap switch for peanuts nowadays... much more flexible than using RS232. Ethernet cables are dirt cheap too.

 
What if the host failed to boot and is stuck in single user mode?
Sure, there are times when real serial terminals are useful. It all depends what the objective is. It struck me reading the OP's post that its probably a lot cheaper nowadays to hook up with ethernet than with RS232. Unless he's got a lot of old hardware already there. Anyway it was only a suggestion :)
 
you may hack gettytab and ttys to run cu ( a shell script which invokes cu) instead of login on ttyv4+ but then everyone with local access can get root by escaping cu ~ (probably)
 
Might seem a daft question but now that ethernet LANs are so cheap... why not just connect them up using ethernet and have done with it? Then you can run sshd on the server and connect to it using ssh.
You can get a cheap switch for peanuts nowadays... much more flexible than using RS232. Ethernet cables are dirt cheap too.
Already using SSH with the headless systems, they are all maintained using Ansible. The serial connection is because the headless servers have IPMI and can redirect everything including Power On Self Test through the serial port before loading an OS.
 
Already using SSH with the headless systems, they are all maintained using Ansible. The serial connection is because the headless servers have IPMI and can redirect everything including Power On Self Test through the serial port before loading an OS.
That makes sense, yes I know IPMI.
 
I have something working almost as I want it to by using tmux. I may have time at the weekend to finish it. I will post here a working config when it's fully debugged.

Pressing function key F1 shows the console for the server
Pressing F10, shows the console for headless1
Pressing F11, shows the console for headless2
Pressing F12, shows the console for headless3

I need to fix my script to prevent nested invocations.
I also need to test that another login ID doesn't inherit the function key mappings.
 
Back
Top