LCSR Serial Console System Developer Documentation
Nicholas Harknett, Developer
Tuesday 28 June 2005
Introduction:
The serial console system at LCSR is a system that allows pseudo-physical access to machines through properly configured serial ports. The system not only allows access, but arranges logging, and session management (starting connection, resuming connections, etc.) Any machine with serial console redirection abilities can be connected to the system, and can then be managed along with the other machines.
Overview of Interacting Components:
The serial console system is comprised of two components, the "Console Client" and the "Console Server". A user of the console system sits at the "Console Client". It is from this location that he can use a keyboard and mouse to connect to all the machines. These machines are managed through the "Console Server." This machine has the configuration data and all of the information that it can use to point traffic to the appropriate serial connections. All serial connections are made with cisco boxes which have a firmware configured to make the negotiation between serial and the machine fairly transparent.
Equipment Information and Specifications:
- Console Server (1) - This can be any i386 compatible machine running linux (testing has been done with a Fedora Core 2 install).
- Console Clients (as many as desired) - Same specifications as Console Server, with the additional requirement of an X server, monitor, and keyboard.
- Cisco Boxes (as many as desired) - Cisco 2511 (16 Serial Interfaces)
- configured with serial consoles on multiple telnet ports
- configured with serial parameters 9600 8N1 (9600 baud, 8 data bits, no parity, 1 stop bit)
- Machines to connect to (only cisco port availability limited)
- any machine w/ serial console capabilities
- configured with serial parameters 9600 8N1 (9600 baud, 8 data bits, no parity, 1 stop bit)
- configure terminal emulation as vt100
Console Server Software Details:
This is the core component of the serial console system. Logging, session starting and resuming is all done with the program GNU Screen. Below are the files involved in the console server and their role / development details. All files are located in /usr/local/ConsoleServer, so an installation can be moved to a different computer or backed-up by solely interacting with that directory. All programs should be run as the user 'console' on the console server, and this machine should allow all console heads to host-based login via ssh. Hostbased should work in the opposite direction as well.
- ./bin/restartsession - This script restarts a connected session
- ./bin/editmachines - This script opens an editor to edit the file ./etc/cservelist
- ./bin/screen - This is the binary of screen. We had to custom compile screen to include telnet support. ./configure --help will list an option that allows this
- ./bin/createsession - This script opens a session by calling screen with the appropriate command line options
- ./bin/propagatehosts - This script pushes the file /etc/hosts (how we do name service w/out DNS) to all of the machines listed in ./etc/clientlist
- ./bin/nukesession - This script forcefully quits a connected screen session. This is useful when killing a defunct process or the likes.
- ./bin/editcolors - This script opens an editor to edit the file ./etc/colorlist This is the file that the console head reads while generating the buttons for the button bar on the left.
- ./bin/breaksession - This script (unused / partially tested) sends a break to a connected screen session. This should work on sun machines, although has not been tested to much extent.
- ./bin/resumesession - This script reconnects to a session and does the stealing from previously opened session as well.
- ./bin/screen-4.0.2 - screen links to this (the real binary)
- ./bin/startsessions - This script goes and starts all the sessions. If desired, this can be run on consoleserver startup or the likes to have all sessions open for logging and whatnot.
- ./etc/cservelist - This is the comma separated list that defines the relationships between machines and the ports / cisco boxes to which they should connect. This also defines the grouping that is used on the console client side for buttons and menus.
- ./etc/clientlist - This is the list of machines that are console clients.
- ./etc/colorlist - This is the list of colors that are then used to code the button bar on the console clients.
- ./screenrc - This is the screen configuration file. It is the stock configuration, except for the additions at the bottom of the file in the commented section.
- /logstorage - The only item left out of /usr/local/ConsoleServer -- This needs to be created as it is where the logs will be stored and read from.
Console Client Software Details:
This is the auxiliary component of the serial console system, and the one users will be interacting with most frequently. Basically, it is a machine that runs the window manager fvwm2 with specific configuration parameters that are all specified and generated within the user console's home directory. Below are all the files involved in the console client, and their usage / details. All these files are found within /home/console and due to the possibility of hard-coded paths, other placement may or may not work. Note: hostbased authentication should be configured as stated at the end of the intro. paragraph to the 'Console Server Software Details.' Note 2: Gdm is configured to automatically login with the user console.
- ./FvwmScript-ConsoleButtons - File generated by Perl-CreateFvwmScript-ConsoleButtons.pl and then referred to by .fvwm2rc to define button bar and associated actions.
- ./.xscreensaver - configuration settings for Xscreensaver - single screen saver that shows screen beneath
- ./PropagateCservelist.pl - gets list of machines and groups to form menus and buttons from console server and then parses it appropriately to discard unneeded information and structure it appropriately
- ./ConfigFvwmTaskBar - configuration file that defines the appearance of the bar at the bottom of the fvwm2 session.
- ./Perl-CreateFvwmScript-ConsoleButtons.pl - main script that creates menus for fvwm, the button bar, and parses all data to do so.
- ./.fvwm/.fvwm2rc - This is the main configuration file for fvwm. It contains all layout definitions for the session. Window handling etc.
- ./.Xclients-default - This file defines the appropriate startup from GDM to use fvwm2
- ./.Xclients - This file points to ./Xclients-default
- ./ConfigFvwmMenu - Generated by the core Perl-CreateFvwmScript-ConsoleButtons.pl script, this file is the menu that is called by .fvwm2rc to be displayed upon clicking the menu button.
- ./sbfix - This is a nifty little fix that passes the appropriate terminal settings to a screen session to display and allow access to more scrollback than by default. This was required to see history of a session connected previously and then resumed.
Configuration for Various Software Items:
- /etc/inittab (on linux machines)
- add line near tty definitions that looks as such
c0:2345:respawn:/sbin/agetty ttyS0 115200 vt100-nav
- add these lines just before the kernel title definitions
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console
- add this to end of 'kernel' line
console=tty0 console=ttyS0,115200n8
- add the following line to the lilo configuration file
serial=0,9600n8