Bug 254151 - Restarting www/varnish6 fails when using varnishd_config option
Summary: Restarting www/varnish6 fails when using varnishd_config option
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-09 06:30 UTC by Daniel Morante
Modified: 2022-03-19 14:12 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (feld)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.
```
Comment 1 Danilo G. Baio freebsd_committer freebsd_triage 2022-03-19 14:12:18 UTC
(In reply to Daniel Morante from comment #0)


Hi.

You can set "127.0.0.1:8000,PROXY" to the varnishd_listen variable to avoid this.