2012-06-01 18:24:53 +00:00
|
|
|
<%= scope.function_template([ 'base/init-d-header' ]) %>
|
2012-05-14 13:15:05 +00:00
|
|
|
|
|
|
|
<%= init_d_prolog %>
|
|
|
|
<%= init_d_prerun %>
|
|
|
|
|
2012-06-04 19:05:38 +00:00
|
|
|
USER=<%= scope.lookupvar('varnish::user') %>
|
|
|
|
GROUP=<%= scope.lookupvar('varnish::group') %>
|
2012-06-04 14:39:23 +00:00
|
|
|
|
2012-05-14 13:15:05 +00:00
|
|
|
start() {
|
|
|
|
echo -n "Starting $NAME: "
|
|
|
|
|
|
|
|
<%= scope.lookupvar('varnish::bin') %> \
|
|
|
|
-P <%= scope.lookupvar('varnish::pid') %> \
|
|
|
|
-T 127.0.0.1:6082 \
|
|
|
|
-u $USER -g $GROUP \
|
|
|
|
-w 1,1,3600 \
|
|
|
|
-f <%= scope.lookupvar('varnish::vcl_path') %> \
|
|
|
|
-s file,<%= scope.lookupvar('varnish::store_file_path') %>
|
|
|
|
RETVAL=$?
|
2012-06-01 18:24:53 +00:00
|
|
|
echo $RETVAL
|
2012-05-14 13:15:05 +00:00
|
|
|
if [ $RETVAL -eq 0 ]; then
|
|
|
|
<%= scope.lookupvar('varnish::ncsa_bin') %> \
|
|
|
|
-P <%= scope.lookupvar('varnish::ncsa_pid') %> \
|
|
|
|
-a -w <%= scope.lookupvar('varnish::ncsa_log') %> -D
|
|
|
|
RETVAL=$?
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "done"
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
echo -n "Stopping $NAME: "
|
|
|
|
|
|
|
|
for pid in <%= scope.lookupvar('varnish::pid') %> <%= scope.lookupvar('varnish::ncsa_pid') %>; do
|
|
|
|
if [ -f $pid ]; then
|
|
|
|
kill `cat $pid`
|
|
|
|
rm $pid
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2012-05-17 00:33:23 +00:00
|
|
|
killall -9 varnishd
|
|
|
|
killall -9 varnishncsa
|
|
|
|
|
2012-05-14 13:15:05 +00:00
|
|
|
echo "done"
|
|
|
|
}
|
|
|
|
|
2012-06-01 18:24:53 +00:00
|
|
|
<%= scope.function_template([ 'base/init-d-actions' ]) %>
|
2012-05-14 13:15:05 +00:00
|
|
|
|