From 633d083ed5129225259f830090145db3473aa673 Mon Sep 17 00:00:00 2001 From: Joe Gornick Date: Tue, 18 Sep 2012 16:57:03 -0500 Subject: varnish: startup plist and instructions Closes #15004. Signed-off-by: Adam Vandenberg --- Library/Formula/varnish.rb | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/varnish.rb b/Library/Formula/varnish.rb index 13b072078..83e4e4c74 100644 --- a/Library/Formula/varnish.rb +++ b/Library/Formula/varnish.rb @@ -15,4 +15,65 @@ class Varnish < Formula system "make install" (var+'varnish').mkpath end + + def caveats; <<-EOS.undent + To launch on startup (port > 1024): + * if this is your first install: + mkdir -p ~/Library/LaunchAgents + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} + + * if this is an upgrade and you already have the #{plist_path.basename} loaded: + launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename} + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} + + To launch on startup (port < 1024): + * if this is your first install: + sudo cp #{plist_path} /Library/LaunchAgents/ + sudo launchctl load -w /Library/LaunchAgents/#{plist_path.basename} + + * if this is an upgrade and you already have the #{plist_path.basename} loaded: + sudo launchctl unload -w /Library/LaunchAgents/#{plist_path.basename} + sudo cp #{plist_path} /Library/LaunchAgents/ + sudo launchctl load -w /Library/LaunchAgents/#{plist_path.basename} + + EOS + end + + def startup_plist; <<-EOPLIST.undent + + + + + Label + #{plist_name} + ProgramArguments + + #{HOMEBREW_PREFIX}/sbin/varnishd + -n + #{var}/varnish + -f + #{etc}/varnish/default.vcl + -s + malloc,1G + -T + 127.0.0.1:2000 + -a + 0.0.0.0:80 + + KeepAlive + + RunAtLoad + + WorkingDirectory + #{HOMEBREW_PREFIX} + StandardErrorPath + #{var}/varnish/varnish.log + StandardOutPath + #{var}/varnish/varnish.log + + + EOPLIST + end end -- cgit v1.2.3