Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
askfirst
action to the init process.Rationale is to allow to define multiple ttys without forking the process and using memory. Especially on the systems where sharing code segment is not possible.
For
askfirst
items the following rules apply:NN:level:askfirst:command
Where
NN
- is a tty number init is going to way for action "Please press Enter".Init will open
/dev/ttyNN
in pid 1 withO_NONBLOCK
and set alarm for 1 second, periodically checking if there's a character and whether it's\n
.Once
\n
character is received, init closes the tty and spawns the process from thecommand
field. When killed it returns to polling tty in pid 1.