At startup, if varnishncsa starts before varnishd it fails with the message: Can't open VSM file (Abandoned VSM file (Varnish not running?) /usr/local/varnish/<hostname>/_.vsm Also, if it starts just after varnishd did but before varnishd finished its initialization, it fails too, with the same message. For the first problem, I think varnishncsa (and varnishlog) rc files need a require varnishd, for the second, I'm not sure how to fix it, wait a bit, check for the file ?
I created a review for a potential fix. Not sure I like it, but it does work. https://reviews.freebsd.org/D3208
A commit references this bug: Author: feld Date: Mon Jul 27 17:53:19 UTC 2015 New revision: 392997 URL: https://svnweb.freebsd.org/changeset/ports/392997 Log: Fix startup script order: varnishncsa and varnishlog require varnishd to start successfully mat reported some latency between starting varnishd and creation of the _.vsm file used for communication, so a start_precmd has been added to varnishncsa and varnishlog. PR: 201586 Differential Revision: https://reviews.freebsd.org/D3208 Changes: head/www/varnish4/Makefile head/www/varnish4/files/varnishlog.in head/www/varnish4/files/varnishncsa.in