File zabbix-proxy.init of Package zabbix

#!/bin/sh
#
# chkconfig: - 85 15
# description: ZABBIX proxy daemon
# config: /etc/zabbix/zabbix_proxy.conf
#

### BEGIN INIT INFO
# Provides: zabbix-proxy
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Start and stop ZABBIX proxy
# Description: ZABBIX proxy
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

if [ -x /usr/sbin/zabbix_proxy ]; then
    exec=zabbix_proxy
else
    exit 5
fi

conf=/etc/zabbix/zabbix_proxy.conf
lockfile=/var/lock/subsys/zabbix-proxy


start()
{
    echo -n $"Starting Zabbix proxy: "
    daemon $exec -c $conf
    rv=$?
    echo
    [ $rv -eq 0 ] && touch $lockfile
    return $rv
}

stop()
{
    echo -n $"Shutting down Zabbix proxy: "
    killproc $exec
    rv=$?
    echo
    [ $rv -eq 0 ] && rm -f $lockfile
    return $rv
}

restart()
{
    stop
    start
}

reload()
{
    echo -n $"Reloading configuration cache"
    $exec -c $conf -R config_cache_reload
}

case "$1" in
    start|stop|restart|reload)
        $1
        ;;
    force-reload)
        restart
        ;;
    status)
        status $exec
        ;;
    try-restart|condrestart)
        if status $exec >/dev/null ; then
            restart
        fi
        ;;
    *)
	echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
	exit 2
	;;
esac

openSUSE Build Service is sponsored by