aboutsummaryrefslogtreecommitdiffstats
path: root/community/zabbix/zabbix-agentd.initd
diff options
context:
space:
mode:
Diffstat (limited to 'community/zabbix/zabbix-agentd.initd')
-rw-r--r--community/zabbix/zabbix-agentd.initd33
1 files changed, 33 insertions, 0 deletions
diff --git a/community/zabbix/zabbix-agentd.initd b/community/zabbix/zabbix-agentd.initd
new file mode 100644
index 0000000000..5b49535a59
--- /dev/null
+++ b/community/zabbix/zabbix-agentd.initd
@@ -0,0 +1,33 @@
+#!/sbin/openrc-run
+# Copyright 1999-2007 Gentoo Foundation
+# 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 $
+
+# ensure the same file is specified as PidFile in /etc/zabbix/zabbix_agentd.conf
+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
+ use zabbix-server
+}
+
+start() {
+ ebegin "Starting Zabbix agent"
+ start-stop-daemon --pidfile ${pidfile} --start --user ${user}:${group} --exec /usr/sbin/zabbix_agentd
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Zabbix agent"
+ start-stop-daemon --stop --user ${user} --pidfile ${pidfile}
+ eend $?
+}
+