Zabbix init script - pid file

3 posts / 0 new
Last post
#1 Wed, 2013-12-11 22:41
dlutt
  • dlutt's picture
  • Offline
  • Last seen: 4 years 3 months ago
  • Joined: 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

Thu, 2013-12-12 00:15
clandmeter
  • clandmeter's picture
  • Offline
  • Last seen: 1 month 2 weeks ago
  • Joined: 2011-05-05

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.

Thu, 2013-12-12 11:01
dlutt
  • dlutt's picture
  • Offline
  • Last seen: 4 years 3 months ago
  • Joined: 2013-12-11
Log in or register to post comments