-
Incident report
-
Resolution: Fixed
-
Trivial
-
None
-
2.4.5
-
CentOS 6
In zabbix-agent 2.4.5-1 on CentOS 6, the following line in /etc/init.d/zabbix-agent:
killproc $prog
Has been changed to:
killproc -p $pidfile -d $timeout $prog
With $pidfile defined as follows:
conf=/etc/zabbix/zabbix_agentd.conf
pidfile=$(grep -e "^PidFile=.*$" $conf | cut -d= -f2)
If PidFile is not specified in /etc/zabbix/zabbix_agentd.conf, then $pidfile ends up empty, and killproc is called as:
killproc -p -d 10 zabbix_agentd
This causes killproc to mistake '-d' for the location of the PID file, and pass it as an argument to dirname, resulting in the following error:
Shutting down Zabbix agent: /usr/bin/dirname: invalid option – 'd'
Try `/usr/bin/dirname --help' for more information.
[FAILED]
To make the init script respect the default value of PidFile, you could do something like:
conf=/etc/zabbix/zabbix_agentd.conf
pidfile=$(grep -e "^PidFile=.*$" $conf | cut -d= -f2)
[ -z $pidfile ] && pidfile=/tmp/zabbix_agentd.pid