Varnish 4 on Debian 8 issue

Dridi Boukelmoune dridi at varni.sh
Wed May 20 11:22:57 CEST 2015


Hi,

On Wed, May 20, 2015 at 11:04 AM, stuartm <varnishlist at amanzi.co.nz> wrote:
> Hi there,
>
> I've been trying to figure out an issue with Varnish 4 on Debian 8 and have
> found a reproducible problem that I'd like to report... What I found was
> that the Varnish service was starting okay but it wasn't using any of the
> parameters I had set in /etc/default/varnish. For example, I had set the
> listening port to be 80, but Varnish would always start with port 6081.

Debian 8 ships varnish with both systemd and classic sysvinit
services. The file /etc/default/varnish is probably used by
/etc/init.d/varnish.

See this list of files:
https://packages.debian.org/jessie/amd64/varnish/filelist

> After reading this blog post:
> https://ma.ttias.be/debug-varnish-4-x-on-systemd-that-fails-to-start, I
> realised that the Varnish service (/lib/systemd/system/varnish.service)
> wasn't using any parameter files - instead it was hard coded to start with
> the default values only. Here's the output of the
> /lib/systemd/system/varnish.service file:
>
> [Unit]
> Description=Varnish HTTP accelerator
>
> [Service]
> Type=forking
> LimitNOFILE=131072
> LimitMEMLOCK=82000
> ExecStartPre=/usr/sbin/varnishd -C -f /etc/varnish/default.vcl
> ExecStart=/usr/sbin/varnishd -a :6081 -T localhost:6082 -f
> /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
> ExecReload=/usr/share/varnish/reload-vcl
>
> [Install]
> WantedBy=multi-user.target
>
> This blog post: https://ma.ttias.be/running-varnish-4-x-on-systemd/,
> indicated that there should be an environments file located here:
> /etc/varnish/varnish.params and this file would be referenced in the
> varnish.service file on this line:
> EnvironmentFile=/etc/varnish/varnish.params. But as you can see the
> varnish.service script doesn't include that line and the parameters file
> doesn't exist on my Debian 8 system.

This is how it was done in Fedora, but you can override the default
systemd service by adding your own varnish.service file in
/etc/systemd/system if you want to use an external files for
parameters or simply change the default ones.

See systemd's documentation:
http://www.freedesktop.org/software/systemd/man/systemd.unit.html

> This issue is reproducible as I've just built another clean system and tried
> again using both the Debian package as well as the Varnish-hosted package
> which I installed using these instructions:
> https://www.varnish-cache.org/installation/debian
>
> My temporary fix is to edit the varnish.service file and manually configure
> the parameters to match my needs, but this isn't ideal.
>
> Hope this report helps.

I hope my response will help too :)

Cheers,
Dridi



More information about the varnish-misc mailing list