[Pkg-varnish-devel] Bug in Varnish Reload script under Ubuntu 16.04

Angel Abad Cerdeira acerdeira at seek.com.au
Thu Jun 1 07:15:45 UTC 2017


Hi,

Hopefully I am trying to reach the right people, forgive me if not.

I think I found a bug/problem while trying to reload Varnish running under Ubuntu 16.04 LTS.

The problem seems to be that Varnish service starts using the configuration from "/lib/systemd/system/varnish.service" while the reload reads the config from "/etc/default/varnish"

I think this is a bug/problem since you should either define your config in one place or the other, not in both.

Fact: "/lib/systemd/system/varnish.service" contains Varnish service config when it starts
Problem: file above defines "/usr/share/varnish/reload-vcl"  and this file uses "/etc/default/varnish" to re-read the config
How to replicate / example:


1.       Install Varnish in Ubuntu 16.04 following https://packagecloud.io/varnishcache/varnish41/install

2.       Install Nginx (so you have a backend to test)

3.       Create own Varnish config in /etc/varnish/my.vcl (copy from /etc/varnish/default.vcl)

4.       Change /etc/varnish/default.vcl so backend is port 80 (nginx default)

a.       .port = "80";

5.       Change /lib/systemd/system/varnish.service so it uses /etc/varnish/my.vcl instead of default.vcl

a.       Run: systemctl daemon-reload

6.       Restart Varnish service

7.       This test should give you the Nginx default page via Varnish now:

a.       curl http://localhost:6081 -v | head

8.       Now reload Varnish: sudo service varnish reload

9.       This test will FAIL with backend failure (as config has been reloaded with default.vcl):

a.       curl http://localhost:6081?nocache -v | head

Hope you could help me rectifying this problem or telling me what I am missing.

In the mean time I am ensuring my scripts always restart Varnish, never reload.

Best regards,
Angel.


Angel Abad Cerdeira
Senior DevOps Engineer

SEEK Limited
Level 6, 541 St Kilda Rd
Melbourne, Victoria, 3004
MOB : +61 467 035 239<tel:%2B61%20467%20035%20239>
URL : www.seek.com.au<http://www.seek.com.au/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-varnish-devel/attachments/20170601/e98b6de6/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: apt-cache show varnish.txt
URL: <http://lists.alioth.debian.org/pipermail/pkg-varnish-devel/attachments/20170601/e98b6de6/attachment.txt>


More information about the Pkg-varnish-devel mailing list