Quellcode durchsuchen

Fix code paths for container early exit

Signed-off-by: Laurent Bercot <[email protected]>
Laurent Bercot vor 9 Monaten
Ursprung
Commit
d80c79218d

+ 1 - 3
layout/rootfs-overlay/package/admin/s6-overlay-@VERSION@/etc/s6-linux-init/skel/rc.init

@@ -38,12 +38,10 @@ if hook=`printcontenv S6_STAGE2_HOOK` && test -n "$hook" ; then
   if test "$r" -gt 0 ; then
     if test "$b" -ge 2 ; then
       echo "$prog: fatal: hook $hook exited $r" 1>&2
+      haltwith "$r"
     elif test "$v" -ge 1 ; then
       echo "$prog: warning: hook $hook exited $r" 1>&2
     fi
-    if test "$b" -ge 2 ; then
-      haltwith "$r"
-    fi
   elif test "$v" -ge 2 ; then
     echo "$prog: info: hook $hook exited $r" 1>&2
   fi

+ 5 - 4
layout/rootfs-overlay/package/admin/s6-overlay-@VERSION@/etc/s6-linux-init/skel/rc.shutdown

@@ -1,7 +1,8 @@
 #!/bin/sh
 
-if v=`printcontenv S6_VERBOSITY` && eltest "$v" =~ '^[[:digit:]]+$' ; then : ; else
-  v=2
+if test -d /run/s6/db ; then
+  if v=`printcontenv S6_VERBOSITY` && eltest "$v" =~ '^[[:digit:]]+$' ; then : ; else
+    v=2
+  fi
+  exec s6-rc -v$v -bda change
 fi
-
-exec s6-rc -v$v -bda change