inittab: Start shell only if console is not null

Denys Vlasenko vda.linux at googlemail.com
Thu Aug 28 13:01:08 UTC 2014


On Thu, Aug 28, 2014 at 2:45 PM, Harald Becker <ralda at gmx.de> wrote:
>>>> If that open fails, then respawning will not be done.
>>>
>>>
>>> Actually I'm testing this and it seems that init keeps spawning child
>>> processes forever, every second. Inside run(), vfork succeds but then
>>> the device open fails and the child process _exits().
>>>
>>> Is there a way to have init completely skip the line if the
>>> controlling tty is not valid or cannot be opened.
>>
>>
>> May be we can disable the inittab entry, when the spawn fail (e.g. process
>> status code -1 or 127), until init get a SIGHUP (reload inittab)?
>
>
> I suggest doing something like the attached patch (this is just for
> clarification - not fully tested).

I don't like special-casing exit code values.

The "proper" fix is to open the file in the parent, before fork.
Then the failure can be detected in the parent.

Arguably, "why bother" is a solution too. ;)


More information about the busybox mailing list