varnishncsa -- please support a config file

Mark Felder feld at feld.me
Fri Oct 30 17:42:19 CET 2015


Hi all,

Can we get config file support for varnishncsa? (possible varnishlog,
too I suppose)

In FreeBSD we're fighting with a shell quote nightmare. We permit users
to set the varnishncsa log file format in /etc/rc.conf via:

varnishncsa_logformat=""

I've had to change the way we drop privs from the rc.subr system to a
custom one based on our daemon(8) utility to successfully pass the
entire string to varnishncsa but we still can't get quotes passed
through. Escaping them isn't working either.

varnishncsa_logformat="%h %l %u %t \"%r\" %s %b \"%{Referer}i\"
\"%{User-agent}i\" (%{Varnish:handling}x)"

# ps ax | grep [n]csa
94729 ??  SsJ   0:00.01 /usr/local/bin/varnishncsa -t off -P
/var/run/varnishncsa.pid -D -a -w /data/log/http/varnish_access.log -F
%h %l %u %t %r %s %b %{Referer}i %{User-agent}i (%{Varnish:handling}x)

The quotes end up missing which users (and log parsers) expect to be
there. :(

This is not an easy problem to solve. We could probably fix /etc/rc.subr
in FreeBSD but the reality is that it will not be usable by current
users. We will have to wait for the update to trickle down into newer
releases and older releases to be EoL. (so around 2017)

If we could read settings from a config file it would solve this problem
cleanly...


Thanks

-- 
  Mark Felder
  feld at feld.me



More information about the varnish-misc mailing list