Escape query string for varnishncsa/varnishlog

Paul Wolstenholme paul.wolstenholme at cbc.ca
Wed Feb 18 21:59:10 CET 2015


I'd like to run varnishncsa with some query options on startup:

varnishncsa  -a -w ${LOGFILE} -D -P ${PIDFILE} -q 'RespStatus >= 400'"

I can't seem to get the special character escaped properly in
/etc/default/varnishncsa using Ubuntu LTS 14.04.

I have tried quite a few variation of things like:
DAEMON_OPTS=" -a -w ${LOGFILE} -D -P ${PIDFILE} -q \\\'RespStatus \\\>\\\=
400\\\'"

I can get it to work by adding a string in /etc/init.d/varnishncsa :

QUERY="'RespStatus >= 400'"

And modifying the start function:

if start-stop-daemon --start --quiet --pidfile ${PIDFILE}  -q ${QUERY} \

Anyone have any suggestion on how to properly escape a query string in the
/etc/default/varnishncsa

Cheers,
Paul
-- 

Paul Wolstenholme
CBC Music - System Administrator
CBC  Vancouver
604.662.6632
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20150218/2525a975/attachment.html>


More information about the varnish-misc mailing list