Bug 472717 - /etc/event.d/rcS doesn't ignore comments in /etc/inittab -- buggy awk script
/etc/event.d/rcS doesn't ignore comments in /etc/inittab -- buggy awk script
Status: CLOSED DUPLICATE of bug 447216
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-11-23 20:55 EST by D. Wagner
Modified: 2014-03-16 23:16 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-11-24 14:15:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description D. Wagner 2008-11-23 20:55:09 EST
Description of problem:

It looks like /etc/event.d/rcS doesn't reliably ignore comments in /etc/inittab.

In particular, if I understand correctly, /etc/event.d/rcS is looking for lines of the form *:*:initdefault:*, where the first two *'s represent arbitrary strings (except that they must not contain a :) and the third * represents an arbitrary string.

As a result if /etc/inittab contains

# id:3:initdefault:

will be interpreted by /etc/event.d/rcS as two valid lines -- it does not ignore the comment.

Here, watch:

$ /bin/awk -F ':' '$3 == "initdefault" { print $2 }'  << EOF
heredoc> # id:3:initdefault:
heredoc> id:5:initdefault:
heredoc> EOF

This is a gotcha that got me when I edited my /etc/inittab by commenting out the line that was previously present and adding a new (non-comment) line; the old commented-out line continued to take effect.

See here for more explanation:

I'm opening a new bug report so that this bug isn't missed.

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

Comment 1 Bill Nottingham 2008-11-24 14:15:49 EST

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

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