recent changes in trunk allow us to specify the userid inside the openwrt makefile. the info is stored int he meta data of the IPK contorl file and users are generated by the new generic postinst trigger. Signed-off-by: John Crispin <blogic@openwrt.org>
31 lines
731 B
Bash
31 lines
731 B
Bash
#!/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} || {
|
|
touch ${SERVICE_PID_FILE}
|
|
chown zabbix:zabbix ${SERVICE_PID_FILE}
|
|
}
|
|
|
|
service_start ${PROG} -c ${CONFIG}
|
|
}
|
|
|
|
stop() {
|
|
service_stop ${PROG}
|
|
}
|