:: [devuan-dev] bug#932: init scripts …
Top Page
Delete this message
Reply to this message
Author: Walter Alejandro Iglesias
Date:  
To: Mark Hindley, 932-quiet
CC: 932, 932-submitter
Subject: [devuan-dev] bug#932: init scripts fail when /var is in a separate partition
Hey Mark,

On Thu, Jan 08, 2026 at 03:11:16PM +0000, Mark Hindley wrote:
> Control: forwarded -1 https://bugs.debian.org/1106830
> Control: fixed -1 3.15-5devuan1
>
> Walter,
>
> This is Debian bug #1106830[1]. It was fixed in sysvinit/3.15-4, and
> sysvinit/3.15-5devuan1. However that version is not in excalibur.
> [...]
>
> [1] https://bugs.debian.org/1106830


Thanks for the info. I'll take a look to the link.

If you think about it just a bit you'll realize it's not necessary to
save the log to disk at the same time the fsck is performed, as the
scripts currently do. So, I made a fix myself. The diffs below move
the "saving the fsck logs to disk" part to mountall.sh. In case
someone find it useful provisionally, there you are:


--- /etc/init.d/checkroot.sh.orig    2026-01-08 15:37:19.219993282 +0100
+++ /etc/init.d/checkroot.sh    2026-01-08 16:27:15.447993386 +0100
@@ -14,7 +14,6 @@
 # Include /usr/bin in path to find on_ac_power if /usr/ is on the root
 # partition.
 PATH=/usr/bin:/sbin:/bin
-FSCK_LOGFILE=/var/log/fsck/checkroot
 [ "$FSCKFIX" ] || FSCKFIX=no
 [ "$SULOGIN" ] || SULOGIN=no
 . /lib/init/vars.sh
@@ -166,23 +165,6 @@ Will restart in 5 seconds."
 #        fi
 #    fi


-    #
-    # See if we want to check the root file system.
-    #
-    FSCKCODE=0
-
-    if [ -e /run/initramfs/fsck-root ]
-    then
-        rootcheck=no
-        # logsave_best_effort but do not display again
-        if [ -x /sbin/logsave ] && [ -e "${FSCK_LOGFILE}" ]; then
-            logsave -s "${FSCK_LOGFILE}" >/dev/null \
-                cat /run/initramfs/fsck.log
-        else
-            log_failure_msg "Cannot persist initramfs fsck.log"
-        fi
-    fi
-
     if is_fastboot_active
     then
         [ "$rootcheck" = yes ] && log_warning_msg "Fast boot enabled, so skipping root file system check."
@@ -224,8 +206,10 @@ Will restart in 5 seconds."
     fi


     #
-    # The actual checking is done here.
+    # See if we want to check the root file system.
     #
+    FSCKCODE=0
+
     if [ "$rootcheck" = yes ]
     then
         force=""
@@ -248,12 +232,12 @@ Will restart in 5 seconds."
         then
             spinner=""
         fi
-        
+
         if [ "$VERBOSE" = no ]
         then
             log_action_begin_msg "Checking root file system"
             $setterm --msg off
-            logsave_best_effort fsck $spinner $force $fix -T -t $roottype $rootdev
+            fsck $spinner $force $fix -T -t $roottype $rootdev
             FSCKCODE=$?
             $setterm --msg on
             if [ "$FSCKCODE" = 0 ]
@@ -264,7 +248,7 @@ Will restart in 5 seconds."
             fi
         else
             log_daemon_msg "Will now check root file system"
-            logsave_best_effort fsck $spinner $force $fix -T -V -t $roottype $rootdev
+            fsck $spinner $force $fix -T -V -t $roottype $rootdev
             FSCKCODE=$?
             log_end_msg $FSCKCODE
         fi
--- /etc/init.d/checkfs.sh.orig    2026-01-08 15:42:23.179988644 +0100
+++ /etc/init.d/checkfs.sh    2026-01-08 16:28:02.315992670 +0100
@@ -98,7 +98,7 @@ Continuing with system boot in 5 seconds
         then
             log_action_begin_msg "Checking file systems"
             $setterm --msg off
-            logsave_best_effort fsck $spinner -T -M -A $fix $force $FSCKTYPES_OPT
+            fsck $spinner -T -M -A $fix $force $FSCKTYPES_OPT
             FSCKCODE=$?
             $setterm --msg on


@@ -120,7 +120,7 @@ Continuing with system boot in 5 seconds
             else
                 log_action_msg "Will now check all file systems"
             fi
-            logsave_best_effort fsck $spinner -V -T -M -A $fix $force $FSCKTYPES_OPT
+            fsck $spinner -V -T -M -A $fix $force $FSCKTYPES_OPT
             FSCKCODE=$?
             if [ "$FSCKCODE" -eq 32 ]
             then
--- /etc/init.d/mountall.sh.orig    2026-01-08 15:40:33.167990323 +0100
+++ /etc/init.d/mountall.sh    2026-01-08 16:33:19.871995622 +0100
@@ -53,6 +53,26 @@ do_start() {
     # tmpfs, we have to make /var/log/fsck appear here. (see #524007)
     mkdir -p /var/log/fsck


+    # Save fsck logs to /var/log/fsck
+    if [ -e /run/initramfs/fsck-root ]
+    then
+        rootcheck=no
+        # logsave_best_effort but do not display again
+        if [ -x /sbin/logsave ] && [ -e /var/log/fsck/checkroot ]; then
+            logsave -s "${FSCK_LOGFILE}" >/dev/null \
+                cat /run/initramfs/fsck.log
+        else
+            log_failure_msg "Cannot persist initramfs fsck.log"
+        fi
+    fi
+    if [ -x /sbin/logsave ] && [ -e /var/log/fsck/checkfs ]; then
+        logsave -s /var/log/fsck/checkfs >/dev/null \
+            cat /run/initramfs/fsck.log
+    else
+        log_failure_msg "Cannot persist the following output on disc"
+        "$@"
+    fi
+
     # We might have mounted something over /run; see if
     # /run/initctl is present.  Look for
     # /usr/share/sysvinit/update-rc.d to verify that sysvinit (and
--- /usr/lib/init/mount-functions.sh.orig    2026-01-08 16:15:21.223989620 +0100
+++ /usr/lib/init/mount-functions.sh    2026-01-08 16:15:31.967989456 +0100
@@ -723,14 +723,3 @@ is_fastboot_active() {
     done
     return 1
 }
-
-# This function does not actually belong here; it is duct-tape solution
-# for #901289.
-logsave_best_effort() {
-    if [ -x /sbin/logsave ] && [ -e "${FSCK_LOGFILE}" ]; then
-        logsave -s "${FSCK_LOGFILE}" "$@"
-    else
-        log_failure_msg "Cannot persist the following output on disc"
-        "$@"
-    fi
-}



>
> Mark


--
Walter