Class Init
Methods
adopt
-
Makes
childa child of init. Done after construction, not by passingparentto the constructor: aProcessbuilt with a parent copies the parent's descriptors and skips opening its own console, which would put every command on init's stdio instead of its terminal's.Parameters
- child: Process
Returns void
alive
-
How many killable processes are still alive.
Returns number
killAll
-
Sends
signalto every killable process. Resolves to how many were signalled.Parameters
- signal: number
Returns number
markBooted
-
Returns void
start
wait
-
Resolves to the pid of a child that has exited, which is reaped, times 65536, plus its wait status (as
waitpidpacks it), or to 0 oncetimeoutMspasses (a negative number waits for ever).Parameters
- timeoutMs: number
Returns Promise<number>
waitForBoot
-
Whether
/sbin/initreported that boot finished beforetimeoutMsran out.Parameters
- timeoutMs: number
Returns Promise<boolean>
Woken whenever an adopted child exits, which is what
init_waitsleeps on.