From 3d5766f96a046d0fae736afbb02eed5470e619f6 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 31 Aug 2013 11:38:10 -0400 Subject: [PATCH] Improve statusproc output when process is not running --- stage1/bootscripts/functions | 9 +++++---- stage4/bootscripts/dbus | 2 +- stage5/bootscripts/clamav | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/stage1/bootscripts/functions b/stage1/bootscripts/functions index f7dfc18..4a436e0 100644 --- a/stage1/bootscripts/functions +++ b/stage1/bootscripts/functions @@ -449,7 +449,7 @@ reloadproc() if [ ${?} -ne 0 ]; then sleep 2 - if statusproc ${base} | grep -q "not running"; then + if statusproc ${base} | grep -q "stopped"; then return ${EXIT_CODE_FAILURE} fi fi @@ -510,10 +510,11 @@ statusproc_path() if [ -f ${piddir}/${base}.pid ]; then pid=$(head -1 ${piddir}/${base}.pid) if [ -n "${pid}" ]; then - echo "${base} not running but ${piddir}/${base}.pid exists" + echo "${base} stopped but ${piddir}/${base}.pid exists" return ${EXIT_CODE_FAILURE} fi - else - echo "${base} is not running" fi + + echo "${base} is stopped" + return ${EXIT_CODE_FAILURE} } diff --git a/stage4/bootscripts/dbus b/stage4/bootscripts/dbus index 0efaa69..d4c77f5 100755 --- a/stage4/bootscripts/dbus +++ b/stage4/bootscripts/dbus @@ -12,7 +12,7 @@ DAEMON_DESC="D-BUS Messagebus daemon" DAEMON_OPTS="--config-file=/etc/dbus-1/system.conf" dbus_start() { - if statusproc ${DAEMON} | grep -q "not running"; then + if statusproc ${DAEMON} | grep -q "stopped"; then if [ -f /var/run/dbus/pid ]; then rm /var/run/dbus/pid fi diff --git a/stage5/bootscripts/clamav b/stage5/bootscripts/clamav index 32f32a0..4ecc4f0 100755 --- a/stage5/bootscripts/clamav +++ b/stage5/bootscripts/clamav @@ -9,7 +9,7 @@ SOCKET_DIR="/var/run/clamav" start() { - if statusproc clamd | grep -q "not running"; then + if statusproc clamd | grep -q "stopped"; then # Not taking any chances, removing left-over files rm -f ${SOCKET_DIR}/clamd.{sock,pid} || return 1 fi @@ -17,7 +17,7 @@ start() sleep 1 - if statusproc clamav-milter | grep -q "not running"; then + if statusproc clamav-milter | grep -q "stopped"; then # Not taking any chances, removing left-over files rm -f ${SOCKET_DIR}/clmilter.sock || return 1 fi -- 2.20.1