From c075a8cd0d6991593b5e1183c8c178773272ec4d Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 15 Feb 2014 08:08:13 -0800 Subject: [PATCH] gitwebcache.sh/updateweb.sh: do not spew superfluous errors When checking for a process with kill -0 an error message will be shown if the process does not exist. Send it to /dev/null as it's a normal part of the check and should not be shown. --- jobs/gitwebcache.sh | 4 ++-- jobs/updateweb.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jobs/gitwebcache.sh b/jobs/gitwebcache.sh index e3563f3..d9d9a3a 100755 --- a/jobs/gitwebcache.sh +++ b/jobs/gitwebcache.sh @@ -7,8 +7,8 @@ set -e LOCK_FILE=/tmp/gitwebcache-$cfg_tmpsuffix.lock # Make sure we don't run twice. -if [ -s ${LOCK_FILE} ] && kill -0 $(cat ${LOCK_FILE}); then - echo "Already running (stuck?) with pid $(cat ${LOCK_FILE})" >&2 +if [ -s ${LOCK_FILE} ] && kill -0 $(cat ${LOCK_FILE}) 2>/dev/null; then + echo "Already running gitwebcache.sh (stuck?) with pid $(cat ${LOCK_FILE})" >&2 exit 1 fi echo $$ >${LOCK_FILE} diff --git a/jobs/updateweb.sh b/jobs/updateweb.sh index f0e830f..9c4500e 100755 --- a/jobs/updateweb.sh +++ b/jobs/updateweb.sh @@ -12,8 +12,8 @@ BRANCH=rorcz MAKE=make # Make sure we don't run twice. -if [ -s ${LOCK_FILE} ] && kill -0 $(cat ${LOCK_FILE}); then - echo "Already running (stuck?) with pid $(cat ${LOCK_FILE})" >&2 +if [ -s ${LOCK_FILE} ] && kill -0 $(cat ${LOCK_FILE}) 2>/dev/null; then + echo "Already running updateweb.sh (stuck?) with pid $(cat ${LOCK_FILE})" >&2 exit 1 fi echo $$ >${LOCK_FILE} -- 2.11.4.GIT