Bug 88061

Summary: Serial TTYs in /etc/inittab confuse rc.sysinit
Product: [Retired] Red Hat Linux Reporter: Pete Toscano <shubnub>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: low Docs Contact:
Priority: medium    
Version: 9CC: chris.ricker, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-17 23:03:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 88540    
Attachments:
Description Flags
Patch to fix the regex on line 38 of /etc/rc.d/rc.sysinit none

Description Pete Toscano 2003-04-05 02:10:55 UTC
Description of problem:
I tried adding a serial console to my RH9 box.  Part of this involved adding the
following line to /etc/inittab:

S0:12345:respawn:/sbin/mingetty ttyS0

The for loop on line 38 of /etc/rc.d/rc.sysinit is driven by a grep piped to a sed:

grep '^[0-9]*.*respawn:/sbin/mingetty' /etc/inittab | sed 's/^.* \
tty\([0-9][0-9]*\).*/\1/g'

It looks like the grep part is trying to pull out all the respawning mingetty
lines dealing with standard (non-serial) TTYs.  Unfortunately, the regex given
to grep doesn't quite work this way.  The above grep pulls out the S0 line too
and the piped-to sed starts outputs the following for the for-loop to iterate over:

1
2
3
4
5
6
S0:12345:respawn:/sbin/mingetty ttyS0

The pattern "^[0-9]*.*respawn:/sbin/mingetty" is as good as
"respawn:/sbin/mingetty" since the first "*" means there can be zero or more
digits at the beginning of the line.  I believe that intended pattern should be:

"^[0-9]\+.*respawn:/sbin/mingetty"

This will pull out ensure that all lines extracted will begin with at lest one
digit.

Version-Release number of selected component (if applicable):
initscripts-7.14-1

How reproducible:
Consistent

Steps to Reproduce:
1. Add "S0:12345:respawn:/sbin/mingetty ttyS0" to /etc/inittab
2. Reboot
    
Actual results:
Errors similar to this...
/etc/rc.d/rc.sysinit: line 39: /dev/ttyS0:12345:respawn:/sbin/mingetty: No such
file or directory
/etc/rc.d/rc.sysinit: line 42: [: ttyS0: integer expression expected


Expected results:
No errors.

Additional info:

Comment 1 Pete Toscano 2003-04-05 02:27:29 UTC
Created attachment 90919 [details]
Patch to fix the regex on line 38 of /etc/rc.d/rc.sysinit

Works for me.

Comment 2 Bill Nottingham 2003-04-07 21:12:53 UTC
Hm, yeah, actually, we don't set up serial consoles with mingetty here (we use
agetty), so we didn't see this.

Comment 3 Bill Nottingham 2003-06-17 23:03:50 UTC
This is changed differently in current code.

Comment 4 Bill Nottingham 2003-06-17 23:06:47 UTC
Will be in 7.25-1.