Bug 982001 - zabbix-agent won't start due to missing /var/run/zabbix dir in package
zabbix-agent won't start due to missing /var/run/zabbix dir in package
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: zabbix (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Volker Fröhlich
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-07 12:37 EDT by Rolf Fokkens
Modified: 2014-09-25 06:36 EDT (History)
9 users (show)

See Also:
Fixed In Version: zabbix-2.0.13-1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-25 06:36:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rolf Fokkens 2013-07-07 12:37:49 EDT
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):
zabbix-agent-2.0.6-2.fc19.x86_64

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
-%endif
 %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-08 22:50:17 EDT
The same applies for the zabbix server. I've reproduced this on Fedora 19.
Comment 2 Brian Pitts 2013-07-08 23:00:55 EDT
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 01:57:56 EDT
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 12:38:44 EST
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 13:30:19 EST
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-07 21:27:06 EST
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 04:25:57 EDT
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 10:04:09 EDT
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 03:04:06 EDT
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 02:45:13 EDT
zabbix-2.0.13-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/zabbix-2.0.13-1.fc19
Comment 11 Fedora Update System 2014-09-12 10:28:01 EDT
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:
https://admin.fedoraproject.org/updates/FEDORA-2014-10722/zabbix-2.0.13-1.fc19
then log in and leave karma (feedback).
Comment 12 Fedora Update System 2014-09-25 06:36:18 EDT
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.