From e6d11c1adf8d007b6942af97c8bc194f7e2cae40 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 9 Mar 2025 17:05:45 +0100 Subject: [PATCH] 10-runit-control: make a hardlink to the currently booted init This ensures the link count of the pid 1 executable remains positive when runit is updated. If the link count is zero, the file system cannot be remounted read-only during shutdown, as the disk space needs to be reclaimed. --- core-services/10-runit-control.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core-services/10-runit-control.sh b/core-services/10-runit-control.sh index f7173e8c..2ab78197 100644 --- a/core-services/10-runit-control.sh +++ b/core-services/10-runit-control.sh @@ -4,3 +4,7 @@ mkdir -p /run/runit install -m000 /dev/null /run/runit/stopit install -m000 /dev/null /run/runit/reboot + +# ensure runit keeps link count >0 if the binary is updated, +# so the rootfs can be remounted read-only +ln -f /bin/runit /bin/.runit.booted