#!/bin/sh # busybox init's ::respawn action once early boot has finished: supervise every # service linked into /var/service. A service directory's supervise/ is a link # to /run/runit/supervise., so runsv keeps its state and control fifo off # the root, which a snapshot boot mounts read-only. # # init starts this beside the console's login shell, and services started then # slow the shell's way to its first prompt by about half a second. So on the # boot's first start this waits until a login shell has read /etc/profile # (/etc/profile.d/wabuntu-runit.sh writes the fifo), at most 10 s. A respawn # finds /run/runit and does not wait. f=/run/runit/console-up if [ ! -d /run/runit ]; then mkdir -p /run/runit if mkfifo -m 0600 $f && exec 3<>$f; then read -r -t 10 _ <&3 # Unlinked before it is closed, so a late writer finds no fifo and # never blocks on one without a reader. rm -f $f exec 3<&- fi fi exec runsvdir /var/service