Control: notfound -1 5.0.0-7+deb9u2
Control: found -1 6.1.1-1+deb10u1
Control: found -1 6.4.0-3
Control: severity -1 minor

Johnathon Tinsley <jtins...@positive-internet.com> writes:

>    * What was the outcome of this action?
>    Errors as follows;
>    Error: Could not get socket :6081: Address already in use
>    (-? gives usage)

This "service varnish configtest" action is run from the initscript,
even though the service was started by systemd. That is potentially
problematic, since /etc/default/varnish is only used by
/etc/init.d/varnish and not by /lib/systemd/system/varnish.service.

"service varnish configtest" runs varnishd with all the options from the
init script configuration in /etc/default/varnish, along with "-C" to
check config. One of the options in /etc/default/varnish is "-a :6081",
and even with "-C" to test and print the config, varnishd attempts to
bind to the port, which won't work when it is already in use by the
running varnish.

This changed between varnish 5 and varnish 6.

Using "-C" with "-a address:port" when a process is listening on that
port worked fine in varnish 5.0.0 in Debian 9 (stretch). Varnish would
check the configuration, and then exit.

Using "-C" with "-a address:port" when a process is listening on that
port does not work in varnish 6.1.1 in Debian 10 (buster) or with
varnish 6.4.0 in Debian 11 (bullseye). Varnish will attempt to bind to
the port, then check configuration and exit.

The init script "configtest" function runs varnishd with all options
defined in /etc/default/varnish to get the path to one or more VCL
files. The "configtest" action will need to use all these flags, adding
a "-C" and removing the arguments used to bind ports.

--
Stig Sandbeck Mathisen
Debian Developer

Reply via email to