Zabbix: import 2.2.2 from packages

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>
This commit is contained in:
Etienne CHAMPETIER
2014-06-04 00:13:16 +02:00
parent bf78697adf
commit 99dcd289e4
10 changed files with 591 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2011 OpenWrt.org
START=60
PROG=/usr/sbin/zabbix_agentd
CONFIG=/etc/zabbix_agentd.conf
SERVICE_PID_FILE=/var/run/zabbix_agentd.pid
start() {
# 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
grep -q "^PidFile=${SERVICE_PID_FILE}" ${CONFIG} || {
logger -s -t ${CONFIG} -p daemon.error "Only \"PidFile=${SERVICE_PID_FILE}\" supported"
return 1
}
grep -q "^AllowRoot=1" ${CONFIG} || {
user_exists zabbix 53 || user_add zabbix 53
group_exists zabbix 53 || group_add zabbix 53
touch ${SERVICE_PID_FILE}
chown zabbix:zabbix ${SERVICE_PID_FILE}
}
service_start ${PROG} -c ${CONFIG}
}
stop() {
service_stop ${PROG}
}