Bug 472717 - /etc/event.d/rcS doesn't ignore comments in /etc/inittab -- buggy awk script
Summary: /etc/event.d/rcS doesn't ignore comments in /etc/inittab -- buggy awk script
Keywords:
Status: CLOSED DUPLICATE of bug 447216
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-24 01:55 UTC by D. Wagner
Modified: 2014-03-17 03:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-11-24 19:15:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description D. Wagner 2008-11-24 01:55:09 UTC
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:
id:5: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
3
5

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:
https://bugzilla.redhat.com/show_bug.cgi?id=447216#c6

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


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

initscripts-8.76.4-1.x86_64

Comment 1 Bill Nottingham 2008-11-24 19:15:49 UTC

*** 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.