Bug 254151

Summary: Restarting www/varnish6 fails when using varnishd_config option
Product: Ports & Packages Reporter: Daniel Morante <daniel>
Component: Individual Port(s)Assignee: Mark Felder <feld>
Status: New ---    
Severity: Affects Many People Flags: bugzilla: maintainer-feedback? (feld)
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   

Description Daniel Morante 2021-03-09 06:30:33 UTC
Restarting the varnishd service fails when using the `varnishd_config` option in /etc/rc.conf.

I have the following (valid) VCL file (`/usr/local/etc/varnish.d/default.vcl`):

```
vcl 4.0;

backend default {
    .host = "127.0.0.1";
    .port = "8080";
	.proxy_header = 2;
}
```

In `/etc/rc.conf` I have:

```
varnishd_enable="YES"
varnishd_config="/usr/local/etc/varnish.d/default.vcl"
varnishd_storage="malloc,6G"
varnishd_extra_flags="-p feature=+http2 -a 127.0.0.1:8000,PROXY"
```

Varnish starts without any problem:

```
# service varnishd start
Performing sanity check on varnishd configuration:
varnishd: the configuration file /usr/local/etc/varnish.d/default.vcl syntax is ok
Starting varnishd.
Warnings:
VCL compiled.

Debug: Version: varnish-6.5.1 revision NOGIT
Debug: Platform: FreeBSD,12.2-RELEASE-p1,amd64,-junix,-smalloc,-sdefault,-hcritbit
Debug: Child (9399) Started
```

If I try to restart it fails:

```
# service varnishd restart
Performing sanity check on varnishd configuration:
/usr/local/etc/rc.d/varnishd: ERROR: varnishd: the configuration file /usr/local/etc/varnish.d/default.vcl syntax is NOT ok
```

I will have to stop, then start:

```
# service varnishd stop && service varnishd start
Stopping varnishd.
Waiting for PIDS: 9391.
Performing sanity check on varnishd configuration:
varnishd: the configuration file /usr/local/etc/varnish.d/default.vcl syntax is ok
Starting varnishd.
Warnings:
VCL compiled.
```