puppet-standalone-mashup/shared/additional-modules/varnish/templates/varnish-init.d

45 lines
988 B
D
Raw Normal View History

2012-05-14 13:15:05 +00:00
<%= scope.function_template('base/init-d-header') %>
<%= init_d_prolog %>
<%= init_d_prerun %>
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=$?
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"
}
<%= scope.function_template('base/init-d-actions') %>