mirror of
https://abf.rosa.ru/djam/zabbix20.git
synced 2025-04-25 06:17:54 +00:00
78 lines
1.4 KiB
Bash
78 lines
1.4 KiB
Bash
#!/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
|
|
|
|
exec=zabbix_proxy
|
|
prog=${exec##*/}
|
|
lockfile=/var/lock/subsys/zabbix-proxy
|
|
conf=
|
|
syscf=zabbix-proxy
|
|
[ -e /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf
|
|
|
|
start()
|
|
{
|
|
echo -n $"Starting Zabbix proxy: "
|
|
daemon --user zabbixsrv $exec
|
|
rv=$?
|
|
echo
|
|
[ $rv -eq 0 ] && touch $lockfile
|
|
return $rv
|
|
}
|
|
|
|
stop()
|
|
{
|
|
echo -n $"Shutting down Zabbix proxy: "
|
|
killproc $prog
|
|
rv=$?
|
|
echo
|
|
[ $rv -eq 0 ] && rm -f $lockfile
|
|
return $rv
|
|
}
|
|
|
|
restart()
|
|
{
|
|
stop
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start|stop|restart)
|
|
$1
|
|
;;
|
|
force-reload)
|
|
restart
|
|
;;
|
|
status)
|
|
status $prog
|
|
;;
|
|
try-restart|condrestart)
|
|
if status $prog >/dev/null ; then
|
|
restart
|
|
fi
|
|
;;
|
|
reload)
|
|
action $"Service ${0##*/} does not support the reload action: " /bin/false
|
|
exit 3
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
|
|
exit 2
|
|
;;
|
|
esac
|
|
|