Safely replacing /etc/s6-rc/compiled

From: Jan Bramkamp <crest_at_rlwinm.de>
Date: Thu, 12 Nov 2015 18:59:30 +0100

Is there a way to update /etc/s6-rc/compiled without risking a broken
system if the power fails midway through the update?
The best I can come up with is to use a symlink to a uniquely named
compiled directory and a recompile wrapper along those lines:

     cd /etc/s6-rc
     s6-rc-compile .compiled-$SUFFIX source
     s6-rc-update $PWD/.compiled-$SUFFIX $* # TODO: avoid $*
     ln -s .compiled-$SUFFIX .compiled-${SUFFIX}.link
     mv .compiled-${SUFFIX}.link compiled
     # TODO: cleanup old .compiled-* dirs
     fsync compiled .
Received on Thu Nov 12 2015 - 17:59:30 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC