So the fix I posted earlier works, but apinger still crash sometimes, so I wrote a watchdog script to put in the crontab.
The "watch_apinger.sh" shell script will look for apinger PID using ps CLI, look for apinger PID using its PID file (in case of SIG_KILL), compare both values, and run "restart_apinger.php" script if needed:
#!/bin/sh
RELAUNCH=0
CUR=$(ps xcopid,command | awk '/apinger/ {print $1}')
PID=$(cat /var/run/apinger.pid)
[ -z "$CUR" ] && RELAUNCH=1
[ -z "$PID" ] && RELAUNCH=1
[ "$CUR" != "$PID" ] && RELAUNCH=1
[ "$RELAUNCH" == 1 ] && ( killall apinger ; /root/restart_apinger.php )
Save it to "/root/watch_apinger.sh" and make it executable :
chmod +x /root/watch_apinger.sh
Then add it to root crontab:
echo "* * * * * /root/watch_apinger.sh" | crontab -