Chapter 11. Lconsole Utility

The Lconsole utility provides a serial port console that lets you do the following:


Note: Lconsole requires that you use a serial multiplexer.

Do not attempt to use Lconsole and the Hoover cluster manager together.

Lconsole consists of the following commands, which are installed on the remote administration node (that is, the node to which the serial multiplexer is connected, which may or may not be the head node):

The /var/Lconsole/logs directory contains Lconsole logs.

This chapter tells you how to do the following:

Configure the Serial Console

You can configure the cluster to do the following:

  • Send boot messages to the remote administration node


    Note: Boot messages can go to either the monitor (the default) or the serial console; however, they cannot be seen in both places.


  • Permit login to the other nodes on their serial ports

Send Boot Messages to the Remote Administration Node

By default, boot messages are sent to the monitor. To send them to the remote administration node instead, do the following on each nonadministration node:

  1. Edit the /etc/lilo.conf file so that it redirects all boot messages to the serial console:

    serial=tty#,baudrate_parity(n|e|o)_bits(7|8)

    The variables are as follows:

    • tty# is the number of the serial port; 0 corresponds to COM1 alias /dev/ttyS0.

    • baudrate is the baud rate of the serial port in bits per second (b/s).

    • parity(n|e|o) is the parity used on the serial line: n for no parity, e for even parity, o for odd parity.

    • bits(7|8) is the number of bits in a character. If the parity value is n, the default is 8; if the parity value is e or o, the default is 7.

    For example, to use port /dev/ttyS0 with a baud rate of 9600 b/s, no parity, and 8 bits per character, enter the following:

    serial=0,9600n8

  2. Under each image area in the /etc/lilo.conf file, add the following:

    append="console=serial_device_in_/dev"

    For example:

    append="console=ttyS0"

    The following example shows an entire /etc/lilo.conf file, with added portions highlighted:

    boot=/dev/hda
    map=/boot/map
    install=/boot/boot.b
    prompt
    timeout=50
    serial=0,9600n8
    image=/boot/vmlinuz-2.2.5-15
            label=linux
            root=/dev/hda1
            initrd=/boot/initrd-2.2.5-15.img
            read-only
            append="console=ttyS0"
    image=/boot/bzImage
            label=new
            root=/dev/hda1
            initrd=/boot/initrd-2.2.5-15.img
            read-only
            append="console=ttyS0"

    For more information, see the lilo.conf(5) man page.

Permit Login on the Serial Port

To permit login on the serial port of a nonadministration node, add the following to the /etc/inittab file on that node:

device#:run_levels:action:getty_program device speed

These items must match what is in the /etc/lilo.conf file.

For example, for the Red Hat base OS:

S0:2345:respawn:/sbin/uugetty ttyS0 DT9600

This means:

  • The device is /dev/ttyS0

  • It can run in levels 2, 3, 4, and 5

  • The uugetty program will be executed, and if it dies it will be restarted (respawn)

  • The device speed is DT9600

For more information, see the inittab(5) and getty(8) man pages.

Configure the Remote Administration Node

On the remote administration node, do the following:

  1. Edit the /etc/services file so that it contains the port number to be used for Lconsole. The recommended port is 5000, but you can choose another free port if you want. For example:

    # Lconsole
    lctelnet        5000/tcp      

  2. Edit the /etc/inetd.conf file (which describes the services that will be available through the INETD TCP/IP super server) to add the following line:

    # Lconsole
    #
    lctelnet        stream  tcp     nowait  root
    /usr/Lconsole/bin/lctelnetd lctelnetd

    The fields are as follows:

    • Service name: lctelnet

    • Socket type: stream

    • Protocol: tcp

    • Wait status: nowait

    • User: root

    • Server program: /usr/Lconsole/bin/lctelnetd

    • Server program arguments: lctelnetd

    For more information, see the inetd.conf(8) man page.

  3. Create a file named /var/Lconsole/.LC/clustername/nodename for each nonadministration node. In the file, add the following:

    • Console port

    • Reset port

    • Logging options

    For example, the file /var/Lconsole/.LC/acmecluster/node04 could contain the following:

    #CONSOLE    EMP         USER  BAUD  LOG  DFLTPW
    /dev/ttyR0  /dev/ttyR9  root  9600  yes  yes

    This means:

    • The console port is /dev/ttyR0

    • The emergency management port (EMP) is /dev/ttyR9

    • The user who can perform a reset is root

    • The baud rate is 9600

    • Logging to a file is turned on

    • The use of a default password (none) is turned on (if this field is no, then the user must supply a password)


Note: The /dev/tty values above are device dependent and may change on site.


Connect to Lconsole

To connect to the Linux console on the remote administration node, enter the following from any workstation on your network:

$ telnet hostname port


Note: Rather than a hostname, you could enter the node's IP address.

For example, to log into a remote administration node named node04, enter the following:

$ telnet node04.acme.com 5000
Trying 192.168.0.4...
Connected to node04.sgi.com.
Escape character is '^]'.

Red Hat Linux release 6.0 (Hedwig)
Kernel 2.2.5-15 on an i686

LConsole Login: root
Password:
def...


Lconsole Release 1.1
Copyright 1995-1998 Silicon Graphics, Inc.All Rights Reserved.



   Main Menu:
   Clusters
   -----------
   1. acmecluster

You must then specify your Lconsole user name and password.

Use Lconsole Features

This section tells you how to use and exit from Lconsole.

Operations

The Lconsole utility allows you to perform the following functions on any node in the cluster:

  • Connect to the node's console. This is useful if the network is down.

  • Reset the hardware

  • Power up the node

  • Power down the node

  • Steal an occupied console line from another user


Note: To use the reset, power up, and power down operations, you must first set the DISPLAY variable to your remote workstation. (Xlib routines are used to handle asynchronous IO routines.) For example:
$ export DISPLAY=myworkstation:0


For example, to connect to the console for node04, enter the following:

           System 'node04':
           Available Operations
           --------------------
           1. Connect to Serial Console
           2. Hardware Reset
           3. Power Up
           4. Power Down
           5. Steal Occupied Console Line

        Enter choice (1 - 5) or '..' for Systems Menu: 1

----------- Connected port=/dev/ttyR1 -----------
  9600 BAUD 8 NONE 1 SWFC=ON  HWFC=OFF
CAR=OFF DTR=ON  RTS=ON  CTS=OFF DSR=OFF
Type ~X to Exit.
Connection Ready.


Exit

To exit from Lconsole, you must be at the main menu:

  • To leave the node console and return to the Available Operations menu, press ~X

  • To leave the Available Operations menu and return to the Available Systems menu, enter .. (dot dot)

  • To leave the Available Systems menu and return to the Main Menu, enter..(dotdot)

  • To exit from Lconsole from the Main Menu, enter q.

For example:

           System 'node02':
           Available Operations
           --------------------
           1. Connect to Serial Console
           2. Hardware Reset
           3. Power Up
           4. Power Down
           5. Steal Occupied Console Line

        Enter choice (1 - 5) or '..' for Systems Menu: 1

----------- Connected port=/dev/ttyR3 -----------
  9600 BAUD 8 NONE 1 SWFC=ON  HWFC=OFF
CAR=OFF DTR=ON  RTS=ON  CTS=OFF DSR=ON
Type ~X to Exit.
Connection Ready.
Lconsole DINC closing...
~X
------------
        Connect to Console done.


           System 'node02':
           Available Operations
           --------------------
           1. Connect to Serial Console
           2. Hardware Reset
           3. Power Up
           4. Power Down
           5. Steal Occupied Console Line

        Enter choice (1 - 5) or '..' for Systems Menu: ..


        Cluster 'acmecluster':
        Available Systems
        -----------------
        1. node01
        2. node02
        3. node03
        4. node04

        Enter choice (1 - 4) or '..' for Main Menu: ..


   Main Menu:
   Clusters
   ---------------
   1. acmecluster

   Enter choice 1 or 'q' to Quit: q
Connection closed by foreign host.

Add Lconsole Users and Change Passwords

To add an Lconsole user, enter the following as root:

# /usr/Lconsole/bin/lcpasswd [username] password
Re-enter password: password

For example:

#  /usr/Lconsole/bin/lcpasswd lhj
Creating console User password for user lhj
New console password: (password_not_shown)
Retype new console password: (password_not_shown)
lcpasswd: Success

If you do not supply a username, the current login is the default. Passwords are stored in /usr/Lconsole/adm.

The same process is used to change the password for an existing user.

Delete Lconsole Users

To delete an Lconsole user, enter the following as root:

# lcpasswd -d username