Zabbix init script - pid file
-
- Offline
- 4 years 3 months ago
- 2013-12-11
Alpine 2.7.2
Zabbix 2.0.10
I've installed and configured Zabbix (zabbix-server, zabbix-agent...) but Zabbix server can't be correctly started/stopped.
In the zabbix server init script you'll find:
start() { ebegin "Starting Zabbix server" start-stop-daemon --start --user zabbix:zabbix --exec /usr/sbin/zabbix_server eend $? } stop() { ebegin "Stopping Zabbix server" start-stop-daemon --stop --user zabbix --pidfile /var/run/zabbix/zabbix_server.pid eend $? }
When you define
PidFile=/var/run/zabbix/zabbix_server.pid
in the zabbix configuration file "zabbix_server.conf" then Zabbix server fails to start with the message
cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [2] No such file or directory
This is, because the directory /var/run/zabbix doesn't exist. If you change the location from /var/run/zabbix to /var/run then you'll get a permission denied error like
cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [13] Permission denied
The same problem exists for the zabbix agent because the default init script assumes that the pid file is located here:
/var/run/zabbix/zabbix_agentd.pid
But the directory does mot exist so the agent and server will fail.
At the moment I use as "workaround"
start() { mkdir /var/run/zabbix chown zabbix:zabbix /var/run/zabbix
in the init script but I'm not sure if this is a "good" and reliable solution.
Thanks.
Daniel
The apk should create the directory for you and set the correct perms.
Please file a bug on bugs.alpinelinux.org and we will look into it.
New issue created: http://bugs.alpinelinux.org/issues/2487