From cddbd002f96a0c81c11c7f496cdcdc8060c869d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20S=C3=89RIE?= Date: Mon, 5 Aug 2013 15:46:18 +0200 Subject: [PATCH] Fix a bug in the way of killing evobackup. Fix a bug in the way of killing evobackup. The process is launched by "run-parts /etc/cron.daily". When you kill the process, run-parts is not informed and the process go in Z state (and rsync continue to work!). When another run-parts is launched the part wich kill a process if already launched fail. This fix this particular bug. --- crons/zzz_evobackup | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crons/zzz_evobackup b/crons/zzz_evobackup index c6f7d03..4a8d109 100644 --- a/crons/zzz_evobackup +++ b/crons/zzz_evobackup @@ -5,7 +5,12 @@ # Verify if an EvoBackup is already launched, if true, kill it. if [ -e $PIDFILE ]; then - pkill -9 -F $PIDFILE + # Killing the childs of evobackup. + for pid in $(ps h --ppid $(cat $PIDFILE) -o pid | tr -s '\n' ' '); do + kill -9 $pid; + done + # Then kill the main PID. + kill -9 $(cat $PIDFILE) echo "$0 is running (PID $(cat $PIDFILE)). Process killed." >&2 fi echo "$$" > $PIDFILE