1 |
#! /bin/sh |
2 |
# |
3 |
# chkconfig: 345 85 15 |
4 |
# description: zabbix server daemon |
5 |
# |
6 |
### BEGIN INIT INFO |
7 |
# Provides: zabbix |
8 |
# Should-Start: $network |
9 |
# Should-Stop: $network |
10 |
# Default-Start: 3 4 5 |
11 |
# Short-Description: Starts the Zabbix server daemon |
12 |
# Description: This startup script launches Zabbix server daemon |
13 |
### END INIT INFO |
14 |
|
15 |
# zabbix details |
16 |
ZABBIX=/usr/sbin/zabbix_server |
17 |
CONF=/etc/zabbix/zabbix_server.conf |
18 |
PIDFILE=/var/run/zabbix.pid |
19 |
|
20 |
# Source function library. |
21 |
. /etc/rc.d/init.d/functions |
22 |
|
23 |
# Source networking configuration. |
24 |
. /etc/sysconfig/network |
25 |
|
26 |
# Check that networking is up. |
27 |
[ ${NETWORKING} = "no" ] && exit 0 |
28 |
|
29 |
[ -x $ZABBIX ] || exit 0 |
30 |
[ -e $CONF ] || exit 0 |
31 |
|
32 |
RETVAL=0 |
33 |
|
34 |
case "$1" in |
35 |
start) |
36 |
echo -n "Starting zabbix server: " |
37 |
daemon $ZABBIX -c $CONF |
38 |
RETVAL=$? |
39 |
echo |
40 |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix |
41 |
;; |
42 |
stop) |
43 |
echo -n "Shutting down zabbix server: " |
44 |
killproc zabbix_server |
45 |
RETVAL=$? |
46 |
echo |
47 |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix |
48 |
;; |
49 |
restart|reload) |
50 |
$0 stop |
51 |
$0 start |
52 |
RETVAL=$? |
53 |
;; |
54 |
status) |
55 |
status zabbix_server |
56 |
RETVAL=$? |
57 |
;; |
58 |
*) |
59 |
echo "Usage: $0 {start|stop|restart|reload|status}" |
60 |
exit 1 |
61 |
;; |
62 |
esac |
63 |
|
64 |
exit $RETVAL |
65 |
|