diff --git a/cronjobs/run-crons.sh b/cronjobs/run-crons.sh index 55dee0bd..66c59c1f 100755 --- a/cronjobs/run-crons.sh +++ b/cronjobs/run-crons.sh @@ -115,7 +115,10 @@ if [[ -e $PIDFILE ]]; then fi # Write our PID file -echo $PID > $PIDFILE +echo $PID 2>/dev/null 1> $PIDFILE || { + echo 'Failed to create PID file, aborting'; + exit 1 +} for cron in $CRONS; do [[ $VERBOSE == 1 ]] && echo "Running $cron, check logfile for details" diff --git a/cronjobs/run-maintenance.sh b/cronjobs/run-maintenance.sh index cd3ae296..1161f4cd 100755 --- a/cronjobs/run-maintenance.sh +++ b/cronjobs/run-maintenance.sh @@ -115,7 +115,10 @@ if [[ -e $PIDFILE ]]; then fi # Write our PID file -echo $PID > $PIDFILE +echo $PID 2>/dev/null 1> $PIDFILE || { + echo 'Failed to create PID file, aborting'; + exit 1 +} for cron in $CRONS; do [[ $VERBOSE == 1 ]] && echo "Running $cron, check logfile for details" diff --git a/cronjobs/run-payout.sh b/cronjobs/run-payout.sh index d14a56bd..5534122f 100755 --- a/cronjobs/run-payout.sh +++ b/cronjobs/run-payout.sh @@ -115,7 +115,10 @@ if [[ -e $PIDFILE ]]; then fi # Write our PID file -echo $PID > $PIDFILE +echo $PID 2>/dev/null 1> $PIDFILE || { + echo 'Failed to create PID file, aborting'; + exit 1 +} for cron in $CRONS; do [[ $VERBOSE == 1 ]] && echo "Running $cron, check logfile for details" diff --git a/cronjobs/run-statistics.sh b/cronjobs/run-statistics.sh index d41ac2a1..9aa29737 100755 --- a/cronjobs/run-statistics.sh +++ b/cronjobs/run-statistics.sh @@ -115,7 +115,10 @@ if [[ -e $PIDFILE ]]; then fi # Write our PID file -echo $PID > $PIDFILE +echo $PID 2>/dev/null 1> $PIDFILE || { + echo 'Failed to create PID file, aborting'; + exit 1 +} for cron in $CRONS; do [[ $VERBOSE == 1 ]] && echo "Running $cron, check logfile for details"