mirror of
https://github.com/openwrt/packages.git
synced 2026-01-10 09:40:18 +04:00
Zabbix: import 2.2.2 from packages
Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>
This commit is contained in:
33
admin/zabbix/files/zabbix_agentd.init
Normal file
33
admin/zabbix/files/zabbix_agentd.init
Normal 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}
|
||||
}
|
||||
Reference in New Issue
Block a user