Bug 116514 - rc.sysinit has broken grep for mingetty lines from /etc/inittab
rc.sysinit has broken grep for mingetty lines from /etc/inittab
Status: CLOSED DUPLICATE of bug 97188
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
9
i686 Linux
low Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-21 23:59 EST by Dave Baker
Modified: 2014-03-16 22:42 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 14:01:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dave Baker 2004-02-21 23:59:12 EST
Description of problem:

** THIS BUG IS IN INITSCRIPTS -- the bug submission page appears
broken and does not let me select it **


/etc/rc.d/rc.sysinit contains the following line to initialize tty
devices:

for i in `LC_ALL=C grep '^[0-9]*.*respawn:/sbin/mingetty' /etc/inittab
| sed 's/^.* tty\([0-9][0-9]*\).*/\1/g'`; do

The grep expression is incorrect.  [0-9]* will also match zero
characters, meaning it matches any lines that are also commented out
in /etc/inittab.  This becomes a problem when, say, running under
user-mode-linux where copies tty shells are unnecessarily spawned.

Spending a few minutes in testing, I wasn't able to get [0-9]+ to work
as expected so can only suggest one of the following as a correction:

Option 1:
for i in `LC_ALL=C grep '^[0-9][0-9]*.*respawn:/sbin/mingetty'
/etc/inittab | sed 's/^.* tty\([0-9][0-9]*\).*/\1/g'`; do

Option 2:
for i in `LC_ALL=C grep '^[0-9]*:.*respawn:/sbin/mingetty'
/etc/inittab | sed 's/^.* tty\([0-9][0-9]*\).*/\1/g'`; do


How reproducible: Demonstratable problem
Comment 1 Dave Baker 2004-02-22 00:00:26 EST
s/copies/copious/
Comment 2 Bill Nottingham 2004-02-22 00:48:30 EST

*** This bug has been marked as a duplicate of 97188 ***
Comment 3 Red Hat Bugzilla 2006-02-21 14:01:31 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.