with agent startup scripts, provided by zabbix, agent fails to start if pid file is there - even if no actual process is running.
so, i'd like to porpose copyig misc/init.d/suse/9.3/zabbix_agentd to misc/init.d/suse/10/zabbix_agentd and improve it there.
given that the script already handles the situation when pidfile exists, but the process is not running (by using checkproc), a very simple patch follows to allows zabbix_agentd startup even if system was not gracefully shutdown :
such a situation probably could be handled in zabbix_agentd itself, but this change is trivial and fast to apply.
the problem also might be relevant for other startup scripts, but i don't want to mess up all of them
so, i'd like to porpose copyig misc/init.d/suse/9.3/zabbix_agentd to misc/init.d/suse/10/zabbix_agentd and improve it there.
given that the script already handles the situation when pidfile exists, but the process is not running (by using checkproc), a very simple patch follows to allows zabbix_agentd startup even if system was not gracefully shutdown :
Code:
--- zabbix_agentd (revision 4387)
+++ zabbix_agentd (working copy)
@@ -45,8 +45,13 @@
echo -n "Starting ${NAME} "
checkproc -p ${ZABBIX_PID} ${ZABBIX_BIN}
case $? in
- 0) echo -n "- Warning: ${NAME} already running! " ;;
- 1) echo -n "- Warning: ${ZABBIX_PID} exists! " ;;
+ 0)
+ echo -n "- Warning: ${NAME} already running! "
+ ;;
+ 1)
+ echo -n "- Warning: ${ZABBIX_PID} exists! "
+ rm "$ZABBIX_PID"
+ ;;
esac
startproc -p ${ZABBIX_PID} -u zabbix ${ZABBIX_BIN}
the problem also might be relevant for other startup scripts, but i don't want to mess up all of them