Hello,
I would like to suggest an improvement on zabbix_server init script.
The problem with the previous one is that when you run service zabbix_server stop, the script doesn't wait that zabbix_server process really end.
So I updated it to wait for zabbix_server process end before going further:
stop() {
RETVAL=0
# Stop daemons.
echo -n $"Stopping $prog: "
pid=`/sbin/pidof -s $prog`
if [ -n "$pid" ]; then
kill -TERM $pid
else
failure $"$prog stop"
echo
return 1
fi
RETVAL=$?
PID=`/sbin/pidof -s $prog`
while [ -n "$PID" ]; do
sleep 1
PID=`/sbin/pidof -s $prog`
done
[ $RETVAL -ne 0 ] && failure $"$prog stop"
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog && success $"$prog stop"
echo
return $RETVAL
}
I would like to suggest an improvement on zabbix_server init script.
The problem with the previous one is that when you run service zabbix_server stop, the script doesn't wait that zabbix_server process really end.
So I updated it to wait for zabbix_server process end before going further:
stop() {
RETVAL=0
# Stop daemons.
echo -n $"Stopping $prog: "
pid=`/sbin/pidof -s $prog`
if [ -n "$pid" ]; then
kill -TERM $pid
else
failure $"$prog stop"
echo
return 1
fi
RETVAL=$?
PID=`/sbin/pidof -s $prog`
while [ -n "$PID" ]; do
sleep 1
PID=`/sbin/pidof -s $prog`
done
[ $RETVAL -ne 0 ] && failure $"$prog stop"
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog && success $"$prog stop"
echo
return $RETVAL
}