Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1132440

Summary: Wrong Type in systemd unit-file
Product: [Fedora] Fedora EPEL Reporter: Mikael Bergemalm <mbergemalm>
Component: zabbix22Assignee: Volker Fröhlich <volker27>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: volker27
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: zabbix22-2.2.6-2.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-24 03:42:10 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:23:10 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): zabbix22-agent-2.2.5-1.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 Mikael Bergemalm 2014-09-04 12:43:16 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 2 Volker Fröhlich 2014-09-04 21:51:05 UTC
I did that. I removed RemainAfterExit, however.

Comment 3 Fedora Update System 2014-09-04 21:53:01 UTC
zabbix22-2.2.6-2.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-2394/zabbix22-2.2.6-2.el7

Comment 4 Mikael Bergemalm 2014-09-05 19:24:05 UTC
Great! Yes, RemainAfterExit should be removed as well.

Comment 5 Fedora Update System 2014-09-24 03:42:10 UTC
zabbix22-2.2.6-2.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.