Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to put a getty on ttyS2 on a RHEL 6.1 box so I can use IPMI's serial-over-ethernet functionality to log in to a machine when SSH isn't working.

In the past (on Ubuntu?), I used to add a line like this to /etc/inittab:

S1:2345:respawn:/sbin/agetty -h ttyS2 19200 vt100

But I see various files like /etc/init/start-ttys.conf, /etc/init/tty.conf, and /etc/init/serial.conf, and I suspect that the proper to do this on RHEL might be different. What's the right way to do this?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

While what you've posted will work in RHEL 6, I see that RH have somewhat quickly deprecated using inittab for running TTYs.

The stuff in /etc/init is from Upstart (I thought you'd be familiar with that coming from Ubuntu) a replacement for sysV initialization (i.e. what used to be in /etc/init.d and /etc/rc.d/rcX.d dirs). And in the case of the files you specify, configures the serial port hardware.

When all else fails RTFM:

The /etc/inittab file is deprecated, and is now used only for setting up the default runlevel ... To configure a getty running on a non-default serial console, you must now write an Upstart job instead of editing /etc/inittab. For example...

I suppose it makes sense to start the getty's on a modern machine lower in the stack than the inittab. However for the purpose of providing backup remote admin access, I think it would be far more sensible to start a console on the serial port. i.e. see the stuff about /etc/init/start-ttys.conf

share|improve this answer

There is a guide available here which is quite old, but should be at least mostly correct for your Red Hat.

In short, what you posted should work as long as:

  • your kernel supports serial tty (it probably does)
  • you have /dev/ttyS2 - or otherwise, have /dev/ttyS0 and change ttyS2 to ttyS0 in your getty line.

to have earlier serial console output, you might also try appending console=/dev/ttyS0 to your kernel command line. Even better, you can have serial console from grub.

See also this guide mainly for grub and kernel side.

share|improve this answer
    
The agetty command definitely works for my scenario (I tested it out, after some trial and error to figure out which serial port was associated with the IPMI console). My question was more about the "right" way to invoke agetty for the latest version of RHEL. –  Lorin Hochstein Aug 22 '11 at 17:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.