bugSystem V style init programs - Bugs: bug #35859, Small letter 's' in inittab...


bug #35859: Small letter 's' in inittab doesn't work

Submitted by:  None
Submitted on:  Thu 15 Mar 2012 09:17:32 PM UTC  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 16 Mar 2012 03:50:49 PM UTC, comment #1:

The `S' in inittab is special, with this you may override the
intrinisic emergency shell of SysVinit. To use an other program
as /sbin/sulogin, nothing more and nothing less (IMHO).

You should not use those special ID for others like once entries.

Dr. Werner Fink <wfink>
Project Administrator
Thu 15 Mar 2012 09:17:32 PM UTC, original submission:

init version: 2.88dsf

For example:

----- /etc/initscript -----
echo initscript: $1 $2 $3 $4 $5 $6
eval exec "$4"

----- /etc/inittab -----
abc:3s4:once:/bin/echo abc
def:3S4:once:/bin/echo def

Then execute command lines:
"init 5"
"init 4"

It prints:
initscript: abc 3s4 once /bin/echo abc
small letter 's' ^

In single-user level line "abc" doesn't work. Is it correct? Maybe only "S" letter is allowed in runlevels field?

I discovered something strange in read_inittab function:

> for(f = 0; f < (int)sizeof(rlevel) - 1 && rlevel[f]; f++) {
> ch->rlevel[f] = rlevel[f];
> if (ch->rlevel[f] == 's') ch->rlevel[f] = 'S';
> }

------> strncpy(ch->rlevel, rlevel, sizeof(ch->rlevel) - 1);

Note: start_if_needed is case sensitive.

> void start_if_needed(void)
> ...
> if (strchr(ch->rlevel, runlevel) ||
> ...



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by newguy (Updated the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-02-28 newguy Open/ClosedOpen => Closed
    2012-03-16 wfink StatusNone => Invalid

    Back to the top

    Powered by Savane 3.3