systemd Piping varnishncsa Output

Nigel Peck np.lists at sharphosting.uk
Fri Apr 7 23:51:48 CEST 2017


Just to update this thread, I got it resolved following some advice on 
the StackExchange Unix & Linux site:
http://unix.stackexchange.com/questions/356648/pipe-output-to-program-with-systemd

On 07/04/2017 01:21, Nigel Peck wrote:
> 
> Hi,
> 
> I'm trying to pipe the output from varnishncsa when running through systemd on CentOS 7 and having a lot of trouble. I read through every relevant post in the archives and search for hours on Google but haven't solved it yet.
> 
> I'm trying to pipe to cronolog. The only thing I've got to work takes over the foreground, and nothing I've tried for running it in the background works. How can I set up varnishncsa.service so that output is piped to a program instead of written to a file? Should I still run varnishncsa with -D or not? If not how does the PID get written so it can be stopped again by systemctl?
> 
> I got it to work while taking over the foreground with this script:
> 
> #!/bin/bash
> /usr/bin/varnishncsa -F '%{X-Real-IP}i %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"' -q "ReqHeader:Host ~ '
> (^|\.)example\.com$'" -C |/usr/sbin/cronolog "/example/varnish_access_log
> .%Y-%m-%d"
> 
> Any assistance greatly appreciated.
> 
> Thanks
> Nigel
> 
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
> 



More information about the varnish-misc mailing list