Commit a19cbb3f authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

zabbix-agent2 is not forking but rather foreground service. No need for PID either

parent 1eea128e
......@@ -69,7 +69,6 @@ agent2:
$(MAKE) -C zabbix-5.4.2 PATH=$$PATH:$(CURDIR)/../go/go/bin GOCACHE=/tmp/gocache GOPATH=$(CURDIR)/../go/go
$(MAKE) -C zabbix-5.4.2 install PATH=$$PATH:$(CURDIR)/../go/go/bin GOCACHE=/tmp/gocache GOPATH=$(CURDIR)/../go/go
install -v -Dm755 zabbix_agentd-configure /usr/sbin/zabbix_agentd-configure
sed -e 's|.*PidFile=.*|PidFile=/run/zabbix/zabbix_agent2.pid|' -i /etc/zabbix_agent2.conf
sed -e 's|.*LogType=.*|LogType=system|' -i /etc/zabbix_agent2.conf
sed -e 's|^LogFile=.*|# LogFile=|' -i /etc/zabbix_agent2.conf
sed -e 's|^Server=.*|# Server=|' -i /etc/zabbix_agent2.conf
......@@ -78,7 +77,6 @@ agent2:
sed -e 's|.*HostMetadataItem=.*|HostMetadataItem=system.sw.os[name]|' -i /etc/zabbix_agent2.conf
sed -e 's|^# Include=/usr/local/etc/zabbix_agentd\.userparams\.conf|Include=/etc/zabbix_agentd.userparams.conf|' -i /etc/zabbix_agent2.conf
sed -e 's|^# Include=/usr/local/etc/zabbix_agentd\.conf\.d/\*\.conf|Include=/etc/zabbix_agentd.conf.d/*.conf|' -i /etc/zabbix_agent2.conf
@echo "d /run/zabbix 755 zabbix zabbix -" > /usr/lib/tmpfiles.d/zabbix.conf
@echo "$$ZABBIX_AGENT2_SERVICE" > /lib/systemd/system/zabbix-agent2.service
systemctl enable zabbix-agent2.service
@echo "$$ZABBIX_AGENT2_CONFIG" >> /etc/config/zabbix
......@@ -92,11 +90,9 @@ Description=Zabbix Agent
After=syslog.target network.target
[Service]
Type=forking
Type=simple
ExecStartPre=/usr/sbin/zabbix_agentd-configure
ExecStart=/usr/sbin/zabbix_agent2
ExecStartPost=sleep 3
PIDFile=/run/zabbix/zabbix_agent2.pid
Restart=always
RestartSec=100
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment