init: propagate exit conditions of children

This patch extends the configuration concept of init with an additional
sub node for the <start> node:

<start name="noux">
  <exit propagate="yes"/>
  ...
</start>

If the 'propagate' attribute is set to "yes", the exit of the respective
child will appear to init's parent as the exit of the entire init
subsystem.

Fixes #1686
This commit is contained in:
Norman Feske
2015-09-15 18:16:31 +02:00
committed by Christian Helmuth
parent 686f53a5c3
commit 0f052357ef
2 changed files with 38 additions and 0 deletions

View File

@@ -299,6 +299,27 @@ as LOG output. To enable the verbose mode, assign the value "yes" to the
'verbose' attribute of the '<config>' node.
Propagation of exit events
==========================
A component can notify its parent about its graceful exit via the exit RPC
function of the parent interface. By default, init responds to such a
notification from one of its children by merely printing a log message but
ignores it otherwise. However, there are scenarios where the exit of a
particular child should result in the exit of the entire init component. To
propagate the exit of a child to the parent of init, start nodes can host the
optional sub node '<exit>' with the attribute 'propagate' set to "yes".
! <config>
! <start name="noux">
! <exit propagate="yes"/>
! ...
! </start>
! </config>
The exit value specified by the exiting child is forwarded to init's parent.
Executing children in chroot environments on Linux
==================================================