source: projects/specs/trunk/z/zabbix/zabbix_proxy.init @ 7440

Revision 7440, 1.4 KB checked in by iwaim, 11 years ago (diff)

new: zabbix

  • Property svn:executable set to *
Line 
1#!/bin/bash
2#
3#       /etc/rc.d/init.d/zabbix_proxy
4#
5# Starts the zabbix_proxy daemon
6#
7# chkconfig: - 96 4
8# description: Zabbix Proxy Server
9# processname: zabbix_proxy
10# pidfile: /var/run/zabbix/zabbix_proxy.pid
11
12# Modified for Zabbix 2.0.0
13# May 2012, Zabbix SIA
14# 2013-02-07: IWAI, Masaharu; based zabbix_server script
15
16# Source function library.
17
18. /etc/init.d/functions
19
20RETVAL=0
21prog="Zabbix Proxy"
22ZABBIX_BIN="/usr/sbin/zabbix_proxy"
23
24if [ ! -x ${ZABBIX_BIN} ] ; then
25        echo -n "${ZABBIX_BIN} not installed! "
26        # Tell the user this has skipped
27        exit 5
28fi
29
30start() {
31        echo -n $"Starting $prog: "
32        daemon $ZABBIX_BIN
33        RETVAL=$?
34        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_proxy
35        echo
36}
37
38stop() {
39        echo -n $"Stopping $prog: "
40        killproc $ZABBIX_BIN
41        RETVAL=$?
42        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix_proxy
43        echo
44}
45
46case "$1" in
47  start)
48        start
49        ;;
50  stop)
51        stop
52        ;;
53  reload|restart)
54        stop
55        sleep 10
56        start
57        RETVAL=$?
58        ;;
59  condrestart)
60        if [ -f /var/lock/subsys/zabbix_proxy ]; then
61            stop
62            start
63        fi
64        ;;
65  status)
66        status $ZABBIX_BIN
67        RETVAL=$?
68        ;;
69  *)
70        echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}"
71        exit 1
72esac
73
74exit $RETVAL
Note: See TracBrowser for help on using the repository browser.