Skip to content

Instantly share code, notes, and snippets.

@ottomata
Created May 1, 2012 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottomata/2571642 to your computer and use it in GitHub Desktop.
Save ottomata/2571642 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -x
# Source function library
. /lib/lsb/init-functions
USER=varnishlog
PIDFILE=/tmp/varnishncsa.pid
DAEMON=/usr/bin/varnishncsa
DAEMON_OPTS='-w 127.0.0.1:8420 -m RxRequest:^(?!PURGE$) -F "%l %n %t %{Varnish:time_firstbyte}x %h %{Varnish:handling}x/%s %b %m http://%{Host}i%U%q - %{Content-Type}o %{Referer}i %{X-Forwarded-For}i %{User-agent}i"'
start-stop-daemon --start --quiet --pidfile ${PIDFILE} --chuid $USER --exec ${DAEMON} -- ${DAEMON_OPTS}
...
root@wmvm:/etc# /tmp/start_varnish.bash
+ . /lib/lsb/init-functions
++ FANCYTTY=
++ '[' -e /etc/lsb-base-logging.sh ']'
++ . /etc/lsb-base-logging.sh
+ USER=varnishlog
+ PIDFILE=/tmp/varnishncsa.pid
+ DAEMON=/usr/bin/varnishncsa
+ DAEMON_OPTS='-w 127.0.0.1:8420 -m RxRequest:^(?!PURGE$) -F "%l %n %t %{Varnish:time_firstbyte}x %h %{Varnish:handling}x/%s %b %m http://%{Host}i%U%q - %{Content-Type}o %{Referer}i %{X-Forwarded-For}i %{User-agent}i"'
+ start-stop-daemon --start --quiet --pidfile /tmp/varnishncsa.pid --chuid varnishlog --exec /usr/bin/varnishncsa -- -w 127.0.0.1:8420 -m 'RxRequest:^(?!PURGE$)' -F '"%l' %n %t '%{Varnish:time_firstbyte}x' %h '%{Varnish:handling}x/%s' %b %m 'http://%{Host}i%U%q' - '%{Content-Type}o' '%{Referer}i' '%{X-Forwarded-For}i' '%{User-agent}i"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment