diff --git a/src/pmcd/rc_pcp b/src/pmcd/rc_pcp index a00297b..70bb360 100644 --- a/src/pmcd/rc_pcp +++ b/src/pmcd/rc_pcp @@ -394,20 +394,20 @@ _shutdown() _get_pids_by_name pmcd >$tmp.tmp if [ ! -s $tmp.tmp ] then - echo "$prog: PMCD not running" + [ "$1" = verbose ] && echo "$prog: PMCD not running" rm -f $PCP_RUN_DIR/pmcd.pid return 0 fi - # if pmcd is running but we can't find a pidfile, or a logfile at the - # configured or default location, assume chroot + # If pmcd is running but we can't find a pidfile, or a logfile at the + # configured or default location, assume this script is being run via + # a chroot build environment (and hence we do not want to kill pmcd). # logf=`_pmcd_logfile` [ -f $logf ] || logf=$RUNDIR/pmcd.log if [ ! -f $PCP_RUN_DIR/pmcd.pid -a ! -f $logf ] then - echo "Process ..." - cat $tmp.tmp + $ECHO $PCP_ECHO_N "PMCD process ... "`cat $tmp.tmp` echo "$prog: Warning: found no $PCP_RUN_DIR/pmcd.pid and no $logf. @@ -427,8 +427,7 @@ Warning: found no $PCP_RUN_DIR/pmcd.pid kill -TERM $TOKILL >/dev/null 2>&1 rm -f $PCP_RUN_DIR/pmcd.pid else - echo "Process ..." - cat $tmp.tmp + $ECHO $PCP_ECHO_N "PMCD process ... "`cat $tmp.tmp` echo "$prog: Warning: process ID in $PCP_RUN_DIR/pmcd.pid is $TOKILL. Check logfile $logf. When you are ready to proceed, remove @@ -450,8 +449,7 @@ Warning: process ID in $PCP_RUN_DIR/pmcd.pid is $TOKILL. done if [ $delay -eq 0 ] # It just WON'T DIE, give up. then - echo "Process ..." - cat $tmp.tmp + $ECHO $PCP_ECHO_N "PMCD process ... "`cat $tmp.tmp` echo "$prog: Warning: PMCD won't die!" exit fi @@ -517,8 +515,7 @@ $RC_RESET case "$1" in 'start'|'restart') - _get_pids_by_name pmcd >$tmp.tmp - [ -f $PCP_RUN_DIR/pmcd.pid -o -s $tmp.tmp ] && _shutdown + _shutdown quietly # PMCD and PMDA messages should go to stderr, not the GUI notifiers # @@ -606,7 +603,7 @@ Error: PMCD control file '"$PCP_PMCDCONF_PATH"' is missing, cannot start PMCD.' # site-local customisations before PCP shutdown # [ -x $PCPLOCAL ] && $PCPLOCAL $VFLAG stop - _shutdown + _shutdown verbose status=0 ;;