1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #!/bin/bash
- #
- # /etc/rc.d/init.d/zabbix_proxy
- #
- # Starts the zabbix_proxy daemon
- #
- # chkconfig: - 96 4
- # description: Zabbix Proxy Server
- # processname: zabbix_proxy
- # pidfile: /var/run/zabbix/zabbix_proxy.pid
- # Modified for Zabbix 2.0.0
- # May 2012, Zabbix SIA
- # 2013-02-07: IWAI, Masaharu; based zabbix_server script
- # Source function library.
- . /etc/init.d/functions
- RETVAL=0
- prog="Zabbix Proxy"
- ZABBIX_BIN="/usr/sbin/zabbix_proxy"
- 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_proxy
- echo
- }
- stop() {
- echo -n $"Stopping $prog: "
- killproc $ZABBIX_BIN
- RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix_proxy
- echo
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- reload|restart)
- stop
- sleep 10
- start
- RETVAL=$?
- ;;
- condrestart)
- if [ -f /var/lock/subsys/zabbix_proxy ]; then
- stop
- start
- fi
- ;;
- status)
- status $ZABBIX_BIN
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}"
- exit 1
- esac
- exit $RETVAL
|