Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 117 lines (96 sloc) 1.825 kb
23b5709 @ingvarha * Fri Sep 12 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.8.20080912s...
ingvarha authored
1 #! /bin/sh
2 #
bebf42d @ingvarha Just small typofixes
ingvarha authored
3 # varnishncsa Control the Varnish NCSA logging daemon
23b5709 @ingvarha * Fri Sep 12 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.8.20080912s...
ingvarha authored
4 #
5 # chkconfig: - 90 10
a404889 Be consistent about naming
Tollef Fog Heen authored
6 # description: Varnish Cache logging daemon
23b5709 @ingvarha * Fri Sep 12 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.8.20080912s...
ingvarha authored
7 # processname: varnishncsa
8 # config:
1d76106 @ingvarha cosmetic changes to redhat initrc scripts
ingvarha authored
9 # pidfile: /var/run/varnishncsa.pid
23b5709 @ingvarha * Fri Sep 12 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.8.20080912s...
ingvarha authored
10
11 ### BEGIN INIT INFO
12 # Provides: varnishncsa
13 # Required-Start: $network $local_fs $remote_fs
14 # Required-Stop: $network $local_fs $remote_fs
d52ebe8 @ingvarha redhat/fedora initscript: Default-Start and Default-Stop for lsb complia...
ingvarha authored
15 # Default-Start:
16 # Default-Stop:
23b5709 @ingvarha * Fri Sep 12 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.8.20080912s...
ingvarha authored
17 # Short-Description: start and stop varnishncsa
bebf42d @ingvarha Just small typofixes
ingvarha authored
18 # Description: Varnish Cache NCSA logging daemon
23b5709 @ingvarha * Fri Sep 12 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.8.20080912s...
ingvarha authored
19 ### END INIT INFO
20
21 # Source function library.
22 . /etc/init.d/functions
23
24 retval=0
25 pidfile="/var/run/varnishncsa.pid"
26 lockfile="/var/lock/subsys/varnishncsa"
0be9d00 @ingvarha default logfile for varnishncsa on redhat/fedora is /var/log/varnish/var...
ingvarha authored
27 logfile="/var/log/varnish/varnishncsa.log"
23b5709 @ingvarha * Fri Sep 12 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.8.20080912s...
ingvarha authored
28
29 exec="/usr/bin/varnishncsa"
30 prog="varnishncsa"
31
32 DAEMON_OPTS="-a -w $logfile -D -P $pidfile"
33
1d76106 @ingvarha cosmetic changes to redhat initrc scripts
ingvarha authored
34 # Include varnishncsa defaults
23b5709 @ingvarha * Fri Sep 12 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.8.20080912s...
ingvarha authored
35 [ -e /etc/sysconfig/varnishncsa ] && . /etc/sysconfig/varnishncsa
36
37 start() {
38
39 if [ ! -x $exec ]
40 then
41 echo $exec not found
42 exit 5
43 fi
44
45 echo -n "Starting varnish ncsa logging daemon: "
46
47 daemon --pidfile $pidfile $exec "$DAEMON_OPTS"
48 echo
49 return $retval
50 }
51
52 stop() {
53 echo -n "Stopping varnish ncsa logging daemon: "
4df4ffa @ingvarha Fixed pidfile issues in redhat package
ingvarha authored
54 killproc -p $pidfile $prog
23b5709 @ingvarha * Fri Sep 12 2008 Ingvar Hagelund <ingvar@linpro.no> - 2.0-0.8.20080912s...
ingvarha authored
55 retval=$?
56 echo
57 [ $retval -eq 0 ] && rm -f $lockfile
58 return $retval
59 }
60
61 restart() {
62 stop
63 start
64 }
65
66 reload() {
67 restart
68 }
69
70 force_reload() {
71 restart
72 }
73
74 rh_status() {
75 status -p $pidfile $prog
76 }
77
78 rh_status_q() {
79 rh_status >/dev/null 2>&1
80 }
81
82 # See how we were called.
83 case "$1" in
84 start)
85 rh_status_q && exit 0
86 $1
87 ;;
88 stop)
89 rh_status_q || exit 0
90 $1
91 ;;
92 restart)
93 $1
94 ;;
95 reload)
96 rh_status_q || exit 7
97 $1
98 ;;
99 force-reload)
100 force_reload
101 ;;
102 status)
103 rh_status
104 ;;
105 condrestart|try-restart)
106 rh_status_q || exit 0
107 restart
108 ;;
109 *)
110 echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
111
112 exit 2
113 esac
114
115 exit $?
116
Something went wrong with that request. Please try again.