Bug 982001 - zabbix-agent won't start due to missing /var/run/zabbix dir in package
Summary: zabbix-agent won't start due to missing /var/run/zabbix dir in package
Alias: None
Product: Fedora
Classification: Fedora
Component: zabbix
Version: 19
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Volker Fröhlich
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2013-07-07 16:37 UTC by Rolf Fokkens
Modified: 2014-09-25 10:36 UTC (History)
9 users (show)

Fixed In Version: zabbix-2.0.13-1.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-09-25 10:36:18 UTC
Type: Bug

Attachments (Terms of Use)

Description Rolf Fokkens 2013-07-07 16:37:49 UTC
Description of problem:

when running "systemctl start zabbix-agent" zabbix-agent won't start. The cause is the fact that the daemon can't write its pid file in /var/run/zabbix because the directory is not there.

Version-Release number of selected component (if applicable):

How reproducible: 100%

Steps to Reproduce:
1. yum install zabbix-agent
2. systemctl start zabbix-agent
3. Notice that zabbix-agent is not running

Actual results:
Zabbix agent is not running

Expected results:
Zabbix agent is running, pid file is in /var/run/zabbix

Additional info:
There seems to be an easy fix, by changinging 

@@ -796,9 +803,7 @@
 %files agent
 %doc conf/zabbix_agentd/*.conf
 %attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix
-%if 0%{?rhel}
 %attr(0775,root,zabbix) %dir %{_localstatedir}/run/zabbix
 %config(noreplace) %{_sysconfdir}/zabbix_agent.conf
 %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_agent.conf
 %config(noreplace) %{_sysconfdir}/zabbix_agentd.conf

Apparently only on RHEL the dir /var/run/zabbix is created, not on fedora. This may mean that zabbix-agent should write it's pid file in /var/lib/zabbix on fedora or the /var/run/zabbix dir should be in the package.

Comment 1 Brian Pitts 2013-07-09 02:50:17 UTC
The same applies for the zabbix server. I've reproduced this on Fedora 19.

Comment 2 Brian Pitts 2013-07-09 03:00:55 UTC
In my case, I had zabbix server installed but not zabbix agent. This caused tmpfile creation to fail with this error.

[pittsb@arrow ~]$ sudo systemd-tmpfiles --create /etc/tmpfiles.d/zabbix.conf 
[/etc/tmpfiles.d/zabbix.conf:1] Unknown user 'zabbix'

After also installing zabbix agent, which created a zabbix user, systemd-tmpfiles succeeded and the zabbix server started okay.

Comment 3 Volker Fröhlich 2013-07-09 05:57:56 UTC
I haven't found the reason for what Rolf describes, but I can see it too. It used to work in F18 and should have been fixed for #904041.

Thanks Brian, that's certainly an issue to address.

Comment 4 Fedora Admin XMLRPC Client 2013-12-31 17:38:44 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Fedora Admin XMLRPC Client 2013-12-31 18:30:19 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Michel Alexandre Salim 2014-03-08 02:27:06 UTC
Hi Volker,

Any plan on fixing this? It still happens even with the 2.0.11 test updates. I'm resorting to creating the directory by hand right now (and using upstream packages for our EL Zabbix server)

Comment 7 Juan Orti 2014-03-10 08:25:57 UTC
The tmpfiles provided with the package is wrong:

systemd-tmpfiles[18108]: [/etc/tmpfiles.d/zabbix.conf:1] Unknown user 'zabbix'.

It should be user 'zabbixsrv' and the file must be placed in %{_tmpfilesdir} (/usr/lib/tmpfiles.d)

Comment 8 Jason Bradley Nance 2014-08-30 14:04:09 UTC
Workaround for /var/run/zabbix portion of this issue is:

$ sudo mkdir /var/run/zabbix
$ sudo chown root:zabbix /var/run/zabbix
$ sudo chmod 0775 /var/run/zabbix
$ sudo chcon -u system_u -t zabbix_var_run_t /var/run/zabbix

This issue exists for the zabbix22 packages on EPEL for EL7 as well.

Comment 9 Volker Fröhlich 2014-09-05 07:04:06 UTC
I'll solve the missing user issue by simply useradding zabbix in the base package instead of doing that in the agent-sub-package. In 2.2 packaging the user groups are split and this problem no longer exists.

Comment 10 Fedora Update System 2014-09-11 06:45:13 UTC
zabbix-2.0.13-1.fc19 has been submitted as an update for Fedora 19.

Comment 11 Fedora Update System 2014-09-12 14:28:01 UTC
Package zabbix-2.0.13-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing zabbix-2.0.13-1.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2014-09-25 10:36:18 UTC
zabbix-2.0.13-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.