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

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

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


Revision 1.2 - (hide annotations) (download)
Thu May 14 03:38:49 2020 UTC (4 years, 6 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 jpp 1.2 #!/bin/sh
2 jpp 1.1 #
3     # chkconfig: - 85 15
4 jpp 1.2 # description: Zabbix proxy daemon
5     # config: /etc/zabbix/zabbix_proxy.conf
6 jpp 1.1 #
7    
8     ### BEGIN INIT INFO
9 jpp 1.2 # Provides: zabbix-proxy
10 jpp 1.1 # 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 jpp 1.2 # Short-Description: Start and stop Zabbix proxy
15     # Description: Zabbix proxy
16 jpp 1.1 ### END INIT INFO
17    
18 jpp 1.2 # 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 jpp 1.1 else
24     exit 5
25     fi
26    
27 jpp 1.2 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 jpp 1.1
32 jpp 1.2 if [ -f /etc/sysconfig/zabbix-proxy ]; then
33     . /etc/sysconfig/zabbix-proxy
34     fi
35 jpp 1.1
36 jpp 1.2 lockfile=/var/lock/subsys/zabbix-proxy
37 jpp 1.1
38 jpp 1.2 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 jpp 1.1
64     case "$1" in
65 jpp 1.2 start|stop|restart)
66     $1
67     ;;
68     force-reload)
69     restart
70 jpp 1.1 ;;
71 jpp 1.2 status)
72     status -p $pidfile $prog
73 jpp 1.1 ;;
74 jpp 1.2 try-restart|condrestart)
75     if status $prog >/dev/null ; then
76     restart
77     fi
78 jpp 1.1 ;;
79 jpp 1.2 reload)
80     action $"Service ${0##*/} does not support the reload action: " /bin/false
81     exit 3
82 jpp 1.1 ;;
83     *)
84 jpp 1.2 echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
85     exit 2
86 jpp 1.1 ;;
87     esac
88    

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