#!/bin/sh # # Starts the zabbix_proxy daemon # # chkconfig: 345 95 5 # # description: zabbix_proxy long service description # # processname: zabbix_proxy # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then msg_network_down "Zabbix Proxy" exit 1 fi else exit 0 fi # Get service config - may override defaults [ -f /etc/sysconfig/zabbix_proxy ] && . /etc/sysconfig/zabbix_proxy pidfile="/var/run/zabbix/zabbix_proxy.pid" start() { # Check if the service is already running? if [ -f /var/lock/subsys/zabbix_proxy ]; then msg_already_running "Zabbix Proxy" return fi msg_starting "Zabbix Proxy" daemon /usr/sbin/zabbix_proxy RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_proxy } stop() { if [ ! -f /var/lock/subsys/zabbix_proxy ]; then msg_not_running "Zabbix Proxy" return fi # Stop daemons. msg_stopping "Zabbix Proxy" killproc --pidfile $pidfile zabbix_proxy -TERM rm -f /var/lock/subsys/zabbix_proxy } condrestart() { if [ ! -f /var/lock/subsys/zabbix_proxy ]; then msg_not_running "Zabbix Proxy" RETVAL=$1 return fi stop start } RETVAL=0 # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; try-restart) condrestart 0 ;; force-reload) condrestart 7 ;; status) status --pidfile $pidfile zabbix_proxy RETVAL=$? ;; *) msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" exit 3 esac exit $RETVAL