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.
69 lines
1.4 KiB
69 lines
1.4 KiB
#! /bin/sh
|
|
#
|
|
# chkconfig: - 85 15
|
|
# description: zabbix proxy daemon
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: zabbix
|
|
# 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
|
|
|
|
# zabbix details
|
|
if [ -x /usr/sbin/zabbix_proxy_mysql ]; then
|
|
ZABBIX_PROXY=zabbix_proxy_mysql
|
|
elif [ -x /usr/sbin/zabbix_proxy_pgsql ]; then
|
|
ZABBIX_PROXY=zabbix_proxy_pgsql
|
|
elif [ -x /usr/sbin/zabbix_proxy_sqlite3 ]; then
|
|
ZABBIX_PROXY=zabbix_proxy_sqlite3
|
|
else
|
|
exit 5
|
|
fi
|
|
|
|
CONF=/etc/zabbix/zabbix_proxy.conf
|
|
PIDFILE=/var/run/zabbix.pid
|
|
|
|
# Source function library.
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
[ -e $CONF ] || exit 6
|
|
|
|
RETVAL=0
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Starting Zabbix Proxy: "
|
|
daemon $ZABBIX_PROXY -c $CONF
|
|
RETVAL=$?
|
|
echo
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix-proxy
|
|
;;
|
|
stop)
|
|
echo -n "Shutting down Zabbix Proxy: "
|
|
killproc $ZABBIX_PROXY
|
|
RETVAL=$?
|
|
echo
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix-proxy
|
|
;;
|
|
restart|reload)
|
|
$0 stop
|
|
$0 start
|
|
RETVAL=$?
|
|
;;
|
|
status)
|
|
status $ZABBIX_PROXY
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload|status}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit $RETVAL
|
|
|
|
|