First Commit
[librecmc/package-feed.git] / admin / zabbix / files / zabbix_agentd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2008-2011 OpenWrt.org
3
4 START=60
5
6 USE_PROCD=1
7 PROG=/usr/sbin/zabbix_agentd
8 CONFIG=/etc/zabbix_agentd.conf
9
10 start_service() {
11         # Sometimes the agentd config was installed in /etc/zabbix/zabbix_agentd.conf
12         [ -f /etc/zabbix/zabbix_agentd.conf ] && mv /etc/zabbix/zabbix_agentd.conf ${CONFIG}
13
14         [ -f ${CONFIG} ] || return 1
15
16         procd_open_instance
17         procd_set_param command ${PROG} -c ${CONFIG} -f
18         procd_set_param respawn
19         procd_set_param stdout 1
20         procd_set_param stderr 1
21         procd_close_instance
22 }
23