From 0cb079251abec91939985b82a7857384c40d85af Mon Sep 17 00:00:00 2001 From: mtm Date: Sun, 22 Jun 2008 15:34:40 +0000 Subject: Don't say we're going to [start|stop] local packages unless there actually are local (pre rc.d) scripts to run. --- etc/rc.d/localpkg | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'etc/rc.d') diff --git a/etc/rc.d/localpkg b/etc/rc.d/localpkg index 5de96ee..7efe504 100644 --- a/etc/rc.d/localpkg +++ b/etc/rc.d/localpkg @@ -16,15 +16,21 @@ stop_cmd="pkg_stop" pkg_start() { + local initdone + # For each dir in $local_startup, search for init scripts matching *.sh # case ${local_startup} in [Nn][Oo] | '') ;; *) - echo -n 'Local package initialization:' + initdone= find_local_scripts_old for script in ${zlist} ${slist}; do + if [ -z "${initdone}" -a -f "${script}" ]; then + echo -n 'Local package initialization:' + initdone=yes + fi if [ -x "${script}" ]; then (set -T trap 'exit 1' 2 @@ -33,20 +39,26 @@ pkg_start() echo -n " (skipping ${script}, not executable)" fi done - echo '.' + [ -n "${initdone}" ] && echo '.' ;; esac } pkg_stop() { + local initdone + case ${local_startup} in [Nn][Oo] | '') ;; *) - echo -n 'Shutting down daemon processes:' + initdone= find_local_scripts_old for script in `reverse_list ${slist} ${zlist}`; do + if [ -z "${initdone}" -a -f "${script}" ]; then + echo -n 'Shutting down daemon processes:' + initdone=yes + fi if [ -x "${script}" ]; then if [ `sysctl -n debug.bootverbose` -eq 1 ]; then echo "==>" ${script} @@ -56,7 +68,7 @@ pkg_stop() ${script} stop) fi done - echo '.' + [ -n "${initdone}" ] && echo '.' ;; esac } -- cgit v1.1