Skip to content

66-shutdownd

The daemon that manages the shutdown procedure for a 66 boot initialization. It is not meant to be called directly and automatically generated by a 66 scandir create|start command invocation.

This program is a modified copy of s6-linux-init-shutdownd.

Interface

66-shutdownd [ -h ] [ -l live ] [ -g gracetime ] [ -B ] [ -c ]
  • 66-shutdownd opens the /run/66/scandir/0/shutdownd/fifo pipe and listens to it. The 66 poweroff, 66 reboot and 66 halt commands send their request to this pipe when they trigger the shutdown procedure.

  • When it receives a request to shut down, 66-shutdownd brings the service trees down itself: it frees the enabled trees, then the boot tree, all marked as shutdown.

  • It then kills the remaining processes, first with a SIGTERM, then—after the grace time specified by the shutdown command—with a SIGKILL.

  • Finally it runs stage 4. On a real machine this unmounts every file system and hands the kernel over to 66-hpr to halt, power off or reboot; in a container it runs an automatically generated script instead. A persistent marker drives this last stage, so a crash in the middle simply restarts it.

Options

  • -h, --help: prints this help.

  • -l, --live live: changes the supervision directory of service to live. By default this will be /run/66. The default can also be changed at compile time by passing the -D livedir=live option to meson setup. An existing absolute path is expected and should be within a writable and executable filesystem - likely a RAM filesystem—see 66 scandir.

  • -g, --grace-time gracetime: specify a grace time between the SIGTERM and the SIGKILL in milliseconds if the shutdown command does not provide one. Defaults to 3000.

  • -B, --container: inform the shutdown daemon that it is running in a container. This changes the nature of stage 4, since exiting a container is slightly different from rebooting a real machine (in particular, pid 1 has to exit, and great care must be given not to leave any zombie hanging around).

  • -c, --no-logger: inform the shutdown daemon that no catch-all logger is running. This also changes the shutdown procedure slightly, since some operations are specific to the existence of a catch-all logger.

Note

The 66-shutdownd binary is not meant to be called directly. It is automatically generated by a 66 scandir program invocation.