From 44aea641c0bbd5b4129dffe6d2134ad09d7e81a4 Mon Sep 17 00:00:00 2001 From: Rakesh Date: Thu, 8 Dec 2016 12:44:17 +0000 Subject: [PATCH] webdis: add plist file Also, do not daemonize when using launchd. Closes #7671. Signed-off-by: Mike McQuaid --- Formula/webdis.rb | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Formula/webdis.rb b/Formula/webdis.rb index 967851a415..91a1ef2cae 100644 --- a/Formula/webdis.rb +++ b/Formula/webdis.rb @@ -18,7 +18,11 @@ class Webdis < Formula system "make" bin.install "webdis" - inreplace "webdis.prod.json", "/var/log/webdis.log", "#{var}/log/webdis.log" + inreplace "webdis.prod.json" do |s| + s.gsub! "/var/log/webdis.log", "#{var}/log/webdis.log" + s.gsub! /daemonize":\s*true/, "daemonize\":\tfalse" + end + etc.install "webdis.json", "webdis.prod.json" end @@ -26,6 +30,34 @@ class Webdis < Formula (var/"log").mkpath end + plist_options :manual => "webdis #{HOMEBREW_PREFIX}/etc/webdis.json" + + def plist; <<-EOS.undent + + + + + Label + #{plist_name} + ProgramArguments + + #{opt_bin}/webdis + #{etc}/webdis.prod.json + + RunAtLoad + + KeepAlive + + SuccessfulExit + + + WorkingDirectory + #{var} + + + EOS + end + test do begin server = fork do