updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / zabbix-server / rc.zabbix-server
blobe3384f5bcffb5ceffd3024cffb1095b1263a5405
1 #!/bin/bash
3 # Source function library.
4 . /etc/rc.conf
5 . /etc/rc.d/functions
6 . /etc/conf.d/zabbix-server
9 start () {
10 stat_busy "Starting zabbix-server"
11 /usr/sbin/zabbix_server &>/dev/null
12 if [ $? -gt 0 ]; then
13 stat_fail
14 else
15 add_daemon zabbix-server
16 stat_done
20 stop() {
21 stat_busy "Stopping zabbix-server"
22 killall zabbix_server
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 for I in `seq 1 $ZBX_STOP_TIMEOUT`; do
27 pidof zabbix_server >/dev/null || break
28 sleep 1
29 done
30 pidof zabbix_server >/dev/null && stat_fail || (rm_daemon zabbix-server; stat_done)
34 # See how we were called.
35 case $1 in
36 start)
37 start
39 stop)
40 stop
42 restart)
43 stop
44 start
47 echo $"Usage: zabbix-server {start|stop|restart}"
48 exit 1
49 esac
51 exit $RETVAL