You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
731 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2008-2011 OpenWrt.org
  3. START=60
  4. PROG=/usr/sbin/zabbix_agentd
  5. CONFIG=/etc/zabbix_agentd.conf
  6. SERVICE_PID_FILE=/var/run/zabbix_agentd.pid
  7. start() {
  8. # Sometimes the agentd config was installed in /etc/zabbix/zabbix_agentd.conf
  9. [ -f /etc/zabbix/zabbix_agentd.conf ] && mv /etc/zabbix/zabbix_agentd.conf ${CONFIG}
  10. [ -f ${CONFIG} ] || return 1
  11. grep -q "^PidFile=${SERVICE_PID_FILE}" ${CONFIG} || {
  12. logger -s -t ${CONFIG} -p daemon.error "Only \"PidFile=${SERVICE_PID_FILE}\" supported"
  13. return 1
  14. }
  15. grep -q "^AllowRoot=1" ${CONFIG} || {
  16. touch ${SERVICE_PID_FILE}
  17. chown zabbix:zabbix ${SERVICE_PID_FILE}
  18. }
  19. service_start ${PROG} -c ${CONFIG}
  20. }
  21. stop() {
  22. service_stop ${PROG}
  23. }