Replace ps for pgrep to list evobackup child procs

The command being used to identify evobackup child processes isn't
supported on OpenBSD. The pgrep command is supported on both Linux and
OpenBSD.
This commit is contained in:
Tristan PILAT 2019-09-05 11:41:56 +02:00
parent 35f3434237
commit 7eecbe3745

View file

@ -114,7 +114,7 @@ pick_server() {
if [ -e "${PIDFILE}" ]; then
pid=$(cat "${PIDFILE}")
# Killing the childs of evobackup.
for ppid in $(ps h --ppid "${pid}" -o pid | tr -s '\n' ' '); do
for ppid in $(pgrep -P "${pid}"); do
kill -9 "${ppid}";
done
# Then kill the main PID.