Bug 201586

Summary: www/varnish4: rc scripts not ordered properly
Product: Ports & Packages Reporter: Mathieu Arnold <mat>
Component: Individual Port(s)Assignee: Mark Felder <feld>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (feld)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Mathieu Arnold freebsd_committer freebsd_triage 2015-07-15 14:29:11 UTC
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 ?
Comment 1 Mark Felder freebsd_committer freebsd_triage 2015-07-26 16:24:54 UTC
I created a review for a potential fix. Not sure I like it, but it does work.

https://reviews.freebsd.org/D3208
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-07-27 17:53:24 UTC
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