Bug 756045

Summary: Serial console not properly configured when switching to runlevel 1
Product: Red Hat Enterprise Linux 6 Reporter: Christopher J Suleski <csuleski>
Component: initscriptsAssignee: initscripts Maintenance Team <initscripts-maint-list>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1CC: linbao.zhang, lnykryn, nan.chen2, plautrba
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-23 09:01:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Christopher J Suleski 2011-11-22 15:32:39 UTC
Description of problem:
When switching to runlevel 1 from runlevel 3, control of the serial console is passed directly to sushell or sulogin (configured in /etc/sysconfig/init). The serial console loses its terminal settings during the runlevel change, making it impossible to login via sulogin. Entering any key immediately kicks back an incorrect password response. sushell has similar problems but executing "reset" can fix that condition.

Version-Release number of selected component (if applicable):
initscripts-9.03.23-1.el6

How reproducible:
Always

Steps to Reproduce:
1. Configure a serial console in RHEL6, set SINGLE=/sbin/sulogin in /etc/sysconfig/init
2. Boot into runlevel 3, then switch to runlevel 1
3. Try entering the root password
  
Actual results:
Password input is not taken, sulogin immediately rejects any input. If sushell is specified instead, newlines do not work for output.

Expected results:
Should be able to enter password to sulogin. For sushell, the terminal should properly print newlines.

Additional info:
This does not occur when booting directly into a single mode serial console, only when switching from a higher runlevel.

Executing "stty sane" before "exec $SINGLE" in /etc/init/rcS-sulogin.conf works around this problem by setting certain terminal defaults.

I had considered filing a bug against sysvinit-tools because sulogin is not resetting the terminal, but this issue also affects sushell which simply passes control to the default shell. The easiest fix may be addressing this in initscripts.

Comment 1 Petr Lautrbach 2011-11-23 09:01:38 UTC

*** This bug has been marked as a duplicate of bug 746801 ***

Comment 2 Lin-Bao Zhang 2013-01-29 04:23:39 UTC
we are HP guys , we can access this bug 756045 , but we can't access 746801. Anyone can update the latest news about this bug? thanks. 
this bug can also be reproduced on a DL980 with RHEL 6.4s2,the same issue.
we are testing RHEL6.4s4 ,if we still have this bug, we will re-file a new bugzilla to report this bug again.

Comment 3 Lukáš Nykrýn 2013-01-29 09:27:53 UTC
We have agreed that this should be probably fixed in upstart and patch is quite short. But upstart was not planned no be updated in RHEL6.4.

--- a/init/system.c	
+++ a/init/system.c	
@@ -111,6 +111,7 @@ system_setup_console (ConsoleType type,
 
 		if (type == CONSOLE_OWNER)
 			ioctl (fd, TIOCSCTTY, 1);
+		reset = 1;
 		break;
 	case CONSOLE_NONE:
 		/* No console really means /dev/null */