Bug 1132437

Summary: Wrong Type in systemd unit-file
Product: [Fedora] Fedora EPEL Reporter: Mikael Bergemalm <mbergemalm>
Component: zabbix20Assignee: Volker Fröhlich <volker27>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: dan, volker27
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: zabbix20-2.0.13-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-27 18:44:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mikael Bergemalm 2014-08-21 11:16:54 UTC
Description of problem: Zabbix forks during start causing systemctl not to function as expected (stop/restarts) when unit-file has Type=oneshot.


Version-Release number of selected component (if applicable): zabbix20-agent-2.0.12-3.el7.x86_64


Steps to Reproduce:
1. systemctl stop zabbix-agent

Actual results: zabbix daemons won't exit.


Expected results: zabbix daemons should be stopped.


Additional info: This is solved by using the Type=forking instead.

# cat /usr/lib/systemd/system/zabbix-agent.service 
[Unit]
Description=Zabbix Monitor Agent
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/usr/sbin/zabbix_agentd
RemainAfterExit=yes
User=zabbix

[Install]
WantedBy=multi-user.target

Comment 1 Volker Fröhlich 2014-09-01 22:40:35 UTC
Solved in zabbix22 2.2.6-2 in EL7, zabbix 2.2.6-2 in Rawhide and F21 so far

Comment 2 Mikael Bergemalm 2014-09-04 12:42:40 UTC
The PIDFile statement should also be added, status might be inaccurate otherwise.
"PIDFile=/var/run/zabbix/zabbix_agentd.pid".

So in total:

[Unit]
Description=Zabbix Monitor Agent
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/usr/sbin/zabbix_agentd
RemainAfterExit=yes
User=zabbix
PIDFile=/var/run/zabbix/zabbix_agentd.pid

[Install]
WantedBy=multi-user.target

Comment 3 Mikael Bergemalm 2014-09-05 19:25:47 UTC
As with the zabbix22-agent, the RemainAfterExit should be removed as well. (didn't think about that line).

Comment 4 Fedora Update System 2014-09-11 15:27:53 UTC
zabbix20-2.0.13-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/zabbix20-2.0.13-1.el7

Comment 5 Fedora Update System 2014-09-12 19:07:48 UTC
Package zabbix20-2.0.13-1.el7:
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing zabbix20-2.0.13-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-2644/zabbix20-2.0.13-1.el7
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2014-09-27 18:44:45 UTC
zabbix20-2.0.13-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.