Bug#339955: [Pkg-sysvinit-devel] Bug#339955: sysv-rc: /etc/init.d/*.sh should be sourced in runlevel S

Petter Reinholdtsen pere at hungry.com
Sun Nov 20 07:56:29 UTC 2005


[Petter Reinholdtsen]
> The patch look good, but will be equivalent to a forked subprocess
> when running the scripts in parallel.

Here is a possible patch to avoid running .sh scripts in the
background when using CONCURRENCY=shell.

Index: debian/sysv-rc/etc/init.d/rc
===================================================================
--- debian/sysv-rc/etc/init.d/rc        (revisjon 164)
+++ debian/sysv-rc/etc/init.d/rc        (arbeidskopi)
@@ -58,10 +58,19 @@
            $debug startpar -a $action $scripts
            ;;
        shell)
+           backgrounded=0
            for script in $scripts ; do
-               $debug $script $action &
+               case "$script" in
+                 *.sh)
+                     $debug $sh "$script" $action
+                     ;;
+                 *)
+                     $debug "$script" $action &
+                     backgrounded=1
+                     ;;
+               esac
            done
-           wait
+           [ 1 = "$backgrounded" ] && wait
            ;;
     esac
 }




More information about the Pkg-sysvinit-devel mailing list