Subject: [alpine-devel] [PATCH] main/zabbix: use pid file in zabbix agentd init script

From: Johannes Matheis <[email-masked]>
Date: Sat, 6 Dec 2014 14:05:59 +0000

---
 main/zabbix/zabbix-agentd.initd | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/main/zabbix/zabbix-agentd.initd b/main/zabbix/zabbix-agentd.initd
index 745b35e..08e0ffc 100644
--- a/main/zabbix/zabbix-agentd.initd
+++ b/main/zabbix/zabbix-agentd.initd
@@ -3,6 +3,15 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/files/1.6.6/init.d/zabbix-agentd,v 1.1 2009/10/05 15:55:23 patrick Exp $
 
+pidfile=/var/run/zabbix/zabbix_agentd.pid
+user=zabbix
+group=zabbix
+
+start_pre() {
+	checkpath --owner ${user}:${group} --directory ${pidfile%/*}
+}
+
+
 depend() {
 	need net
 	provide zabbix-agent
@@ -11,12 +20,13 @@ depend() {
 
 start() {
 	ebegin "Starting Zabbix agent"
-	start-stop-daemon --start --user zabbix:zabbix --exec /usr/sbin/zabbix_agentd
+	start-stop-daemon --start --user ${user}:${group} --exec /usr/sbin/zabbix_agentd
 	eend $?
 }
 
 stop() {
 	ebegin "Stopping Zabbix agent"
-	start-stop-daemon  --stop --user zabbix --pidfile /var/run/zabbix/zabbix_agentd.pid
+	start-stop-daemon  --stop --user ${user} --pidfile ${pidfile}
 	eend $?
 }
+
-- 
2.0.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---