Bug#961750: varnish: "service varnish configtest" fails

2020-05-29 Thread Stig Sandbeck Mathisen


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  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



Bug#961750: varnish: "service varnish configtest" fails

2020-05-28 Thread Johnathon Tinsley
Package: varnish
Version: 6.1.1-1+deb10u1
Severity: normal

Dear Maintainer,


   * What led up to the situation?
   Varnish running on default port, 6081. run "service varnish configtest" to 
verify custom configuration.
   configtest reports could not bind to socket, instead of verifying
   configuration. 

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

   * What outcome did you expect instead?
   Runs configtest and tries to compile VCL, alerting on any errors. 



-- System Information:
Debian Release: 10.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-6-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages varnish depends on:
ii  adduser   3.118
ii  gcc   4:8.3.0-1
ii  libc6 2.28-10
ii  libc6-dev [libc-dev]  2.28-10
ii  libedit2  3.1-20181209-1
ii  libjemalloc2  5.1.0-3
ii  libncursesw6  6.1+20181013-2+deb10u2
ii  libpcre3  2:8.39-12
ii  libtinfo6 6.1+20181013-2+deb10u2
ii  libvarnishapi26.1.1-1+deb10u1
ii  lsb-base  10.2019051400

varnish recommends no packages.

Versions of packages varnish suggests:
pn  varnish-doc  

-- Configuration Files:
/etc/varnish/default.vcl changed [not included]

-- no debconf information