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.
66 lines
1.3 KiB
66 lines
1.3 KiB
1 year ago
|
#! /bin/sh
|
||
|
# Copyright (c) 07/2004 A.Tophofen, Germany
|
||
|
# Modified for Zabbix 2.0.0
|
||
|
# May 2012, Zabbix SIA
|
||
|
#
|
||
|
# init.d/zabbix_agentd
|
||
|
#
|
||
|
### BEGIN INIT INFO
|
||
|
# Provides: zabbix_server
|
||
|
# Required-Start: $network $remote_fs $syslog
|
||
|
# Required-Stop:
|
||
|
# Default-Start: 3
|
||
|
# Default-Stop:
|
||
|
# Description: Starts Zabbix_Agentd
|
||
|
### END INIT INFO
|
||
|
|
||
|
. /etc/rc.status
|
||
|
rc_reset
|
||
|
NAME="Zabbix_Server"
|
||
|
|
||
|
ZABBIX_BIN="/usr/local/sbin/zabbix_server"
|
||
|
ZABBIX_PID="/tmp/zabbix_server.pid"
|
||
|
|
||
|
|
||
|
if [ ! -x ${ZABBIX_BIN} ] ; then
|
||
|
echo -n "${ZABBIX_BIN} not installed! "
|
||
|
# Tell the user this has skipped
|
||
|
rc_status -s
|
||
|
exit 5
|
||
|
fi
|
||
|
|
||
|
|
||
|
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin"
|
||
|
|
||
|
case "$1" in
|
||
|
start)
|
||
|
echo -n "Starting ${NAME} "
|
||
|
checkproc -p ${ZABBIX_PID} ${ZABBIX_BIN}
|
||
|
case $? in
|
||
|
0) echo -n "- Warning: ${NAME} already running! " ;;
|
||
|
1) echo -n "- Warning: ${ZABBIX_PID} exists! " ;;
|
||
|
esac
|
||
|
|
||
|
startproc -p ${ZABBIX_PID} ${ZABBIX_BIN} -u zabbix
|
||
|
rc_status -v
|
||
|
;;
|
||
|
stop)
|
||
|
echo -n "Shutting down ${NAME}"
|
||
|
checkproc -p ${ZABBIX_PID} ${ZABBIX_BIN} || echo -n "- Warning: ${NAME} not running! "
|
||
|
killproc -p ${ZABBIX_PID} -TERM ${ZABBIX_BIN}
|
||
|
rc_status -v
|
||
|
;;
|
||
|
restart)
|
||
|
$0 stop
|
||
|
sleep 10
|
||
|
$0 start
|
||
|
rc_status
|
||
|
;;
|
||
|
*)
|
||
|
echo "Usage: $0 {start|stop|restart}"
|
||
|
exit 1
|
||
|
;;
|
||
|
esac
|
||
|
rc_exit
|
||
|
|