Search

Language:  
Search for:

Available article translations:

How to set up a serial console to a Linux server

Article ID: 10041, created on Mar 9, 2011, last review on Aug 15, 2014

APPLIES TO:
  • Operations Automation 5.5
  • Virtuozzo
  • Virtuozzo containers for Linux
  • Virtuozzo hypervisor

Symptoms

Sometimes it is necessary to set up a serial console to troubleshoot kernel crashes and server hang issues on Parallels Server Bare Metal or Parallels Containers for Linux.

Resolution

  1. Connect the Parallels Server Bare Metal or Parallels Containers node (hereafter HW) with the monitoring node (hereafter MN) using a null-modem cable between the two COM ports.
  2. Try to find which of the tty consoles is responsible for the connected COM ports. On MN:

    [root@monitor ~]# ls -l /dev/ttyS?
    crw-rw---- 1 root uucp 4, 64 Feb 23 11:06 /dev/ttyS0
    crw-rw---- 1 root uucp 4, 65 Feb 23 11:06 /dev/ttyS1
    crw-rw---- 1 root uucp 4, 66 Feb 23 11:06 /dev/ttyS2
    crw-rw---- 1 root uucp 4, 67 Feb 23 11:06 /dev/ttyS3
    [root@monitor ~]# cat /dev/ttyS0
    

    If it is not the correct console, you will get this error:

    [root@monitor ~]# cat /dev/ttyS3
    cat: /dev/ttyS3: Input/output error
    

    If you are using correct terminal, then you will see a similar output:

    [root@monitor ~]# cat /dev/ttyS0
    _
    

    Now, jump to HW:

    [root@pvcfl46x64 ~]# for COMPORT in `ls /dev/ttyS?`; do echo ${COMPORT}; echo test > ${COMPORT} ;done
    /dev/ttyS0
    /dev/ttyS1
    -bash: echo: write error: Input/output error
    /dev/ttyS2
    -bash: echo: write error: Input/output error
    /dev/ttyS3
    -bash: echo: write error: Input/output error
    

    We see that /dev/ttyS0 is the correct console.

    Now, jump back to MN and you should see the following message:

    [root@monitor ~]# cat /dev/ttyS0
    test
    

    If you see some garbled text, then the baud rates do not match (but they will be configured later).

  3. Configuring HW:

    Set the debug output to the required console device, e.g., /dev/ttyS0:

    [root@pvcfl46x64 ~]# grep console /etc/grub.conf

    kernel /boot/vmlinuz-2.6.18-028stab070.14 ro root=LABEL=/1 debug console=ttyS0,115200 console=tty

    ttyS0 is the COM port we found in pp.2 and 115200 is the baud rate for sending information.

    Also, the enable debug output in /etc/sysctl.conf:

    [root@pvcfl46x64 ~]# grep printk /etc/sysctl.conf
    kernel.printk = 8 4 1 7
    [root@pvcfl46x64 ~]# sysctl -p
    
  4. Configuring MN:

    Note: It is best to set up ttylogd as per Parallels Containers User Guide:

    1. Find the ttylogd RPM, e.g., from the Parallels Containers distribution, which can be downloaded using the instructions from this KB article:

      [root@pvcfl46x64 ~]# ./virtuozzo-4.0.0-448-x86_64.sfx -d virtuozzo --extract
      extracting...
      Extraction success
      [root@pvcfl46x64 ~]# find virtuozzo/ -iname '*ttylogd*'
      virtuozzo/virtuozzo/RPMS/ttylogd-3.0.0-3.swsoft.x86_64.rpm
      

      Alternatively, you can get the needed package directly:

      1. For 64-bit
      2. For 32-bit
    2. Copy the RPM to MN:

      [root@pvcfl46x64 ~]# scp virtuozzo/virtuozzo/RPMS/ttylogd-3.0.0-3.swsoft.x86_64.rpm root@monitor:/
      The authenticity of host 'monitor (10.55.63.11)' can't be established.
      RSA key fingerprint is 77:91:fa:65:b1:68:43:8e:fa:5a:a2:8c:72:86:99:4c.
      Are you sure you want to continue connecting (yes/no)? yes
      Warning: Permanently added 'monitor' (RSA) to the list of known hosts.
      root@monitor's password:
      ttylogd-3.0.0-3.swsoft.x86_64.rpm 100% 12KB 12.2KB/s 00:00
      [root@pvcfl46x64 ~]#
      
    3. Install ttylogd:

      [root@monitor ~]# rpm -Uvh /ttylogd-3.0.0-3.swsoft.x86_64.rpm
      warning: /ttylogd-3.0.0-3.swsoft.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 2425c37e
      Preparing... ########################################### [100%]
      1:ttylogd ########################################### [100%]
      
    4. Configure ttylogd:

      [root@monitor ~]# cat /etc/ttylog.conf
      DAEMONS="1"
      PORT_OPTIONS_GLOBAL="115200 cs8 -hupcl -cstopb cread clocal -crtscts -icrnl ixon \
      ixoff -opost -isig -icanon -iexten -echo"
      PORT1=/dev/ttyS0
      HOST1=pvcfl46
      LOG1="/var/log/console-${HOST1}.log"
      

      /dev/ttyS0 is the COM port found on MN in pp.2.

      [root@monitor ~]# /etc/init.d/ttylogd restart
      Shutting down ttylogd: [FAILED]
      Starting ttylogd /dev/ttyS0: [ OK ]
      [root@monitor ~]#
      
    5. Reboot the HW node, and in the meantime, check the log on MN:

      [root@monitor ~]# tail -f /var/log/console-pvcfl46.log
      Feb 23 12:10:10 pvcfl46 ttylogd v.2.1.0-5 started
      

Now, if the kernel is crashed, it will be possible to collect and analyze the log on MN.

Note: It is also possible to use USB-to-Serial adapters, and in this case, the device names should be /dev/ttyUSBx instead of /dev/ttySx.

Note: Two Hardware Nodes can be monitors for each other.

Additional Information

For more information, see:

Parallels Containers User guide pages:

For more information about obtaining the full distribution, refer to this article:

  • 10043: How to download full distribution of Parallels Containers for Linux

Search words:

server crash

server hang

serial console

hardware node hang




2897d76d56d2010f4e3a28f864d69223 e8e50b42231236b82df27684e7ec0beb d02f9caf3e11b191a38179103495106f a26b38f94253cdfbf1028d72cf3a498b 0dd5b9380c7d4884d77587f3eb0fa8ef 5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 5b048d9bddf8048a00aba7e0bdadef37 2554725ed606193dd9bbce21365bed4e 614fd0b754f34d5efe9627f2057b8642

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No
 
 
 
 
 
 
Server Virtualization
- Odin Cloud Server
- Odin Containers for Windows 6.0
- Odin Virtuozzo Containers
Automation
- Odin Automation
- Odin Automation for Cloud Infrastructure
- Odin Business Automation Standard
- Odin Virtual Automation
- Odin Plesk Panel Suite
- Web Presence Builder
- Odin Plesk Automation
- Odin Small Business Panel
- Value-added Services for Hosters
- Odin Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification