1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #!/bin/bash
- #
- # /etc/rc.d/init.d/zabbix_agentd
- #
- # Starts the zabbix_agentd daemon
- #
- # chkconfig: - 95 5
- # description: Zabbix Monitoring Agent
- # processname: zabbix_agentd
- # pidfile: /var/run/zabbix/zabbix_agentd.pid
- # Modified for Zabbix 2.0.0
- # May 2012, Zabbix SIA
- # 2012-02-07: IWAI, Masaharu; modified for Vine Linux
- # Source function library.
- . /etc/init.d/functions
- RETVAL=0
- prog="Zabbix Agent"
- ZABBIX_BIN="/usr/sbin/zabbix_agentd"
- if [ ! -x ${ZABBIX_BIN} ] ; then
- echo -n "${ZABBIX_BIN} not installed! "
- # Tell the user this has skipped
- exit 5
- fi
- start() {
- echo -n $"Starting $prog: "
- daemon $ZABBIX_BIN
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_agentd
- echo
- }
- stop() {
- echo -n $"Stopping $prog: "
- killproc $ZABBIX_BIN
- RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix_agentd
- echo
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- reload|restart)
- stop
- sleep 10
- start
- RETVAL=$?
- ;;
- condrestart)
- if [ -f /var/lock/subsys/zabbix_agentd ]; then
- stop
- start
- fi
- ;;
- status)
- status $ZABBIX_BIN
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}"
- exit 1
- esac
- exit $RETVAL
|