From 3d4286b8898ad2b528baf3ac75a09bd42804cd56 Mon Sep 17 00:00:00 2001 From: Thorsten Glaser Date: Sat, 3 May 2014 21:43:05 +0000 Subject: verbose (by default, deactivatable) init scripts --- package/base-files/src/etc/init.d/rcK | 11 +++++++++++ package/base-files/src/etc/init.d/rcS | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/package/base-files/src/etc/init.d/rcK b/package/base-files/src/etc/init.d/rcK index 938882ae5..9859f300a 100755 --- a/package/base-files/src/etc/init.d/rcK +++ b/package/base-files/src/etc/init.d/rcK @@ -1,9 +1,20 @@ #!/bin/sh export PATH=/bin:/sbin:/usr/bin:/usr/sbin +: ${rcquiet=0} { grep '^#INIT ' /etc/init.d/* | \ sort -rnk2 | \ while read line; do + test x"$rcquiet" = x"0" && echo -n "Stopping ${line%%:*}... " sh ${line%%:*} autostop + rc=$? + case $rcquiet:$rc in + (0:0) + echo done. + ;; + (0:*) + echo "failed ($rc)." + ;; + esac done } | logger -s -p 6 -t '' diff --git a/package/base-files/src/etc/init.d/rcS b/package/base-files/src/etc/init.d/rcS index e27bc9eb5..77137e6d3 100755 --- a/package/base-files/src/etc/init.d/rcS +++ b/package/base-files/src/etc/init.d/rcS @@ -6,10 +6,21 @@ fi ln -s /proc/self/fd/2 /dev/stderr echo "System initialization ..." export PATH=/bin:/sbin:/usr/bin:/usr/sbin +: ${rcquiet=0} { grep '^#INIT ' /etc/init.d/* | \ sort -nk2 | \ while read line; do + test x"$rcquiet" = x"0" && echo -n "Starting ${line%%:*}... " sh ${line%%:*} autostart + rc=$? + case $rcquiet:$rc in + (0:0) + echo done. + ;; + (0:*) + echo "failed ($rc)." + ;; + esac done } |tee /dev/stderr |logger -p 6 -t '' -- cgit v1.2.3