1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2008-2011 OpenWrt.org
6 PROG
=/usr
/sbin
/zabbix_agentd
7 CONFIG
=/etc
/zabbix_agentd.conf
8 SERVICE_PID_FILE
=/var
/run
/zabbix_agentd.pid
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}
14 [ -f ${CONFIG} ] ||
return 1
16 grep -q "^PidFile=${SERVICE_PID_FILE}" ${CONFIG} ||
{
17 logger
-s -t ${CONFIG} -p daemon.error
"Only \"PidFile=${SERVICE_PID_FILE}\" supported"
21 grep -q "^AllowRoot=1" ${CONFIG} ||
{
22 user_exists zabbix
53 || user_add zabbix
53
23 group_exists zabbix
53 || group_add zabbix
53
24 touch ${SERVICE_PID_FILE}
25 chown zabbix
:zabbix
${SERVICE_PID_FILE}
28 service_start
${PROG} -c ${CONFIG}