/[smecontribs]/rpms/zabbix/contribs9/zabbix-proxy.init
ViewVC logotype

Contents of /rpms/zabbix/contribs9/zabbix-proxy.init

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Thu May 14 03:38:49 2020 UTC (3 years, 11 months ago) by jpp
Branch: MAIN
CVS Tags: zabbix-4_4_6-2_el6_sme, zabbix-4_4_6-1_el6_sme, zabbix-4_4_6-1_el6, HEAD
Changes since 1.1: +60 -47 lines
import

1 #!/bin/sh
2 #
3 # chkconfig: - 85 15
4 # description: Zabbix proxy daemon
5 # config: /etc/zabbix/zabbix_proxy.conf
6 #
7
8 ### BEGIN INIT INFO
9 # Provides: zabbix-proxy
10 # Required-Start: $local_fs $network
11 # Required-Stop: $local_fs $network
12 # Default-Start:
13 # Default-Stop: 0 1 2 3 4 5 6
14 # Short-Description: Start and stop Zabbix proxy
15 # Description: Zabbix proxy
16 ### END INIT INFO
17
18 # Source function library.
19 . /etc/rc.d/init.d/functions
20
21 if [ -x /usr/sbin/zabbix_proxy ]; then
22 exec=/usr/sbin/zabbix_proxy
23 else
24 exit 5
25 fi
26
27 prog=${exec##*/}
28 conf=/etc/zabbix/zabbix_proxy.conf
29 pidfile=$(grep -e "^PidFile=.*$" $conf | cut -d= -f2 | tr -d '\r')
30 timeout=10
31
32 if [ -f /etc/sysconfig/zabbix-proxy ]; then
33 . /etc/sysconfig/zabbix-proxy
34 fi
35
36 lockfile=/var/lock/subsys/zabbix-proxy
37
38 start()
39 {
40 echo -n $"Starting Zabbix proxy: "
41 daemon $exec -c $conf
42 rv=$?
43 echo
44 [ $rv -eq 0 ] && touch $lockfile
45 return $rv
46 }
47
48 stop()
49 {
50 echo -n $"Shutting down Zabbix proxy: "
51 killproc -p $pidfile -d $timeout $prog
52 rv=$?
53 echo
54 [ $rv -eq 0 ] && rm -f $lockfile
55 return $rv
56 }
57
58 restart()
59 {
60 stop
61 start
62 }
63
64 case "$1" in
65 start|stop|restart)
66 $1
67 ;;
68 force-reload)
69 restart
70 ;;
71 status)
72 status -p $pidfile $prog
73 ;;
74 try-restart|condrestart)
75 if status $prog >/dev/null ; then
76 restart
77 fi
78 ;;
79 reload)
80 action $"Service ${0##*/} does not support the reload action: " /bin/false
81 exit 3
82 ;;
83 *)
84 echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
85 exit 2
86 ;;
87 esac
88

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed