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 - Wrong Type in systemd unit-file
Summary: Wrong Type in systemd unit-file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: zabbix22
Version: epel7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Volker Fröhlich
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-21 11:23 UTC by Mikael Bergemalm
Modified: 2014-09-24 03:42 UTC (History)
1 user (show)

Fixed In Version: zabbix22-2.2.6-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-24 03:42:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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