Bug 201586 - www/varnish4: rc scripts not ordered properly
Summary: www/varnish4: rc scripts not ordered properly
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-15 14:29 UTC by Mathieu Arnold
Modified: 2015-07-27 17:54 UTC (History)
0 users

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 Mathieu Arnold freebsd_committer 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 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 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