diff --git a/builder/build-latest b/builder/build-latest index ff17e18..7b347eb 100755 --- a/builder/build-latest +++ b/builder/build-latest @@ -95,10 +95,10 @@ for output in "${outputs[@]}"; do mkdir -p $overlaydstpath/etc/{cont-init.d,fix-attrs.d,services.d} mkdir -p $overlaydstpath/var/log/s6-uncaught-logs - # create event directory in fdholder, its needed for no-catchall + # create "supervise" directory in fdholder, its needed for no-catchall # stage2 wake up - mkdir -p $overlaydstpath/etc/s6/services/s6-fdholderd/event - chmod 3730 $overlaydstpath/etc/s6/services/s6-fdholderd/event + mkdir -p $overlaydstpath/etc/s6/services/s6-fdholderd/supervise + chmod 0700 $overlaydstpath/etc/s6/services/s6-fdholderd/supervise # fix fix-attrs perms chmod 0755 $overlaydstpath/usr/bin/fix-attrs diff --git a/builder/overlay-rootfs/etc/s6/init-no-catchall/init-stage1 b/builder/overlay-rootfs/etc/s6/init-no-catchall/init-stage1 index c3fd626..51868ec 100644 --- a/builder/overlay-rootfs/etc/s6/init-no-catchall/init-stage1 +++ b/builder/overlay-rootfs/etc/s6/init-no-catchall/init-stage1 @@ -9,6 +9,13 @@ if { s6-hiercopy /etc/s6/services /var/run/s6/services } if { s6-rmrf /var/run/s6/services/s6-svscan-log } +## +## ensure our vital fifo exists +## + +if { s6-mkfifo -m 0600 /var/run/s6/services/s6-fdholderd/supervise/control } + + ## ## fork the "init-stage2" script ## @@ -16,15 +23,8 @@ if { s6-rmrf /var/run/s6/services/s6-svscan-log } background { # block until the supervision tree is running - # NOTE: start waiting as soon as possible because we can get - # into a race condition if "s" was already sent before we - # started listening to the fifodir. - if - { - # keep stderr open, but avoid "s" printing to the outside - redirfd -w 1 /dev/null - s6-ftrig-wait /var/run/s6/services/s6-fdholderd/event "s" - } + redirfd -w 3 /var/run/s6/services/s6-fdholderd/supervise/control + fdclose 3 # add some environment s6-envdir -- /etc/s6/init/env-stage2 @@ -34,6 +34,7 @@ background } unexport ! + ## ## run the rest of stage 1 with sanitized descriptors ##