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.
This commit is contained in:
parent
88fb702b46
commit
92f6db4439
|
@ -8,7 +8,12 @@
|
||||||
# Verification qu'un autre evobackup n'est pas deja lance
|
# Verification qu'un autre evobackup n'est pas deja lance
|
||||||
PIDFILE=/var/run/evobackup.pid
|
PIDFILE=/var/run/evobackup.pid
|
||||||
if [ -e $PIDFILE ]; then
|
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 tourne encore (PID `cat $PIDFILE`). Processus killé" >&2
|
echo "$0 tourne encore (PID `cat $PIDFILE`). Processus killé" >&2
|
||||||
fi
|
fi
|
||||||
echo "$$" > $PIDFILE
|
echo "$$" > $PIDFILE
|
||||||
|
|
Loading…
Reference in a new issue