Note: if the keyboard is not working correctly on the new agetty, you may need to remove console=ttyS0 from the kernel parameters.Īs the system boots, it starts udev to handle hardware devices. Then start the new agetty by rebooting or by running ~]# initctl start serial-ttyS0 ![]() To start agetty on a serial port that is not the primary console, create a new /etc/init/nf file with the following contents: start on stopped rc RUNLEVEL=Įxec /sbin/agetty /dev/ttyS0 115200 vt100-nav This option should be added to the the section called # Run gettys in standard runlevels: # Run gettys in standard runlevelsĬo:2345:respawn:/sbin/agetty ttyS0 115200 vt100Īfter this edit is made, run the following command: # init qįor RHEL6, upstart (the init process) starts an agetty process automatically if the primary console is the serial port (recall that the last console= parameter is the primary). This is achieved by adding the following line to the /etc/inittab file: co:2345:respawn:/sbin/agetty ttyS0 115200 vt100 To do this we need to spawn an agetty process for the serial port. This configuration will set up the serial port as a remote terminal, allowing logins via the serial console. Serial Terminal Configuration in RHEL 4 and RHEL 5 Red Hat Enterprise Linux 7 has a ttyS0 entry in /etc/securetty by default. ttyS0 should be added to the bottom of the list on a new line: tty9 One will also have to add the serial port to the /etc/securetty file in Red Hat Enterprise Linux 4, 5, and 6 to allow root logins through the serial port. If init script messages need to be seen on the serial console as well, it should be made the primary by swapping the order of the console parameters: console=tty0 console=ttyS0,115200Īny settings altered in nf will take effect on the next system reboot. This means messages from init scripts will not go to the serial console, since it is the secondary console, but boot messages and critical warnings will go to the serial console. In the above example, the VGA console tty0 is the primary and the serial console is the secondary display. Note: The primary console for system output will be the last console listed in the kernel parameters. Incorrectly configured baud rate settings might lead to junk character being displayed at login. Before applying any such settings, it is recommended that you also check your server manual. Each server will have its own serial console settings, generally noted in the system BIOS. Note: Regarding the above documented baud rate 115200, the baud rate for a given configuration depends upon the hardware settings. Title Red Hat Enterprise Linux AS (2.4.21-27.0.2.ELsmp) # kernel /vmlinuz-version ro root=/dev/hda2 # all kernel and initrd paths are relative to /boot/, eg. # Note that you do not have to rerun grub after making changes to this file The following example will configure the system to send the console output to the serial port ttyS0 at a baud rate of 115200 as well as sending the output to the regular console or "screen" tty0.Įdit the file /boot/grub/nf by adding the following kernel options to the kernel line: console=ttyS0,115200 console=tty0įor example, in nf: ~]# cat /boot/grub/nf This is usually done via the bootloader we'll be using GRUB in our examples. Serial Console Kernel Option Configurationįirst, to get the kernel to output all console messages to the serial port you need to pass the console=ttyS0 (please note that the trailing character is a zero, not the letter O) parameter to the kernel at boot time. Serial Console Kernel Option Configuration. ![]() This article will cover the configuration of serial terminals in RHEL. A serial terminal, if properly configured, also lets you log on to the system via the serial port as a remote terminal. ![]() A serial console will send all console output to the serial port. It is sometimes helpful to have a serial console for debugging purposes and a serial terminal for headless operation.
0 Comments
Leave a Reply. |