diff --git a/src/im_mad/remotes/common.d/monitord-client-shepherd_local.sh b/src/im_mad/remotes/common.d/monitord-client-shepherd_local.sh index 06a4363566..87630a6af6 100755 --- a/src/im_mad/remotes/common.d/monitord-client-shepherd_local.sh +++ b/src/im_mad/remotes/common.d/monitord-client-shepherd_local.sh @@ -27,7 +27,7 @@ CLIENT_PID_FILE=/tmp/one-monitord-$HID.pid [ -f $CLIENT_PID_FILE ] || exit 0 running_pid=$(cat $CLIENT_PID_FILE) -pids=$(ps axuwww | grep -e "/monitord-client.rb.*${HID} " | grep -v grep | \ +pids=$(ps axuwww | grep "/monitord-client.rb [^\s]* ${HID} ${HNAME}" | grep -v grep | \ awk '{ print $2 }' | grep -v "^${running_pid}$") if [ -n "$pids" ]; then diff --git a/src/im_mad/remotes/run_monitord_client b/src/im_mad/remotes/run_monitord_client index 9f17beb76d..20468c88ad 100755 --- a/src/im_mad/remotes/run_monitord_client +++ b/src/im_mad/remotes/run_monitord_client @@ -33,7 +33,7 @@ function run_dir { cd $1 for i in `ls * | grep -E -v '\.(rpmnew|rpmsave|dpkg-\w+)$'`;do if [ -x "$i" ]; then - result=$(echo ${STDIN} | ./$i ${ARGUMENTS}) + result=$(echo ${STDIN} | ./$i ${ARGUMENTS} 2>&1) EXIT_CODE=$? if [ "x${EXIT_CODE}" != "x0" ]; then