From 68e57287b0ae3e1db77fe9b3e804b3bf182b051e Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Sat, 1 Aug 2020 15:19:30 +0200 Subject: [PATCH] Tidy up runsvdir symlinks during runit phase 1, so that the preparing execution of runsvchdir in phase 2 doesn't choke, if those symlinks are broken --- core-services/99-cleanup.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core-services/99-cleanup.sh b/core-services/99-cleanup.sh index f27f728..4d9acd8 100644 --- a/core-services/99-cleanup.sh +++ b/core-services/99-cleanup.sh @@ -1,5 +1,16 @@ # vim: set ts=4 sw=4 et: +# runsvchdir chokes if the current and/or previous symlinks are broken +if [ -e /etc/runit/runsvdir/previous ]; then + rm /etc/runit/runsvdir/previous +fi +if [ -e /etc/runit/runsvdir/current ]; then + rm /etc/runit/runsvdir/current +fi +# Set the initial runlevel to 'default', even if a different one +# is being selected through the kernel command line (see /etc/runit/2) +ln -s default /etc/runit/runsvdir/current + if [ ! -e /var/log/wtmp ]; then install -m0664 -o root -g utmp /dev/null /var/log/wtmp fi