summaryrefslogtreecommitdiffstats
path: root/admin/zabbix/files/zabbix_agentd.init
blob: 04bef3730d3a6185a14862c05cc70d34c540222f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2011 OpenWrt.org

START=60

USE_PROCD=1
PROG=/usr/sbin/zabbix_agentd
CONFIG=/etc/zabbix_agentd.conf

start_service() {
	# Sometimes the agentd config was installed in /etc/zabbix/zabbix_agentd.conf
	[ -f /etc/zabbix/zabbix_agentd.conf ] && mv /etc/zabbix/zabbix_agentd.conf ${CONFIG}

	[ -f ${CONFIG} ] || return 1

	mkdir -p /var/run/zabbix-agent
	chown zabbix-agent:zabbix-agent /var/run/zabbix-agent

	procd_open_instance
	procd_set_param command ${PROG} -c ${CONFIG} -f
	procd_set_param respawn
	procd_set_param stdout 1
	procd_set_param stderr 1
	procd_close_instance
}