zookeeper: add launchd plist

This commit is contained in:
Sveinn Fannar Kristjansson 2014-04-14 21:34:23 +00:00 committed by Mike McQuaid
parent f20916802d
commit 368cd4bb09

View file

@ -120,4 +120,32 @@ class Zookeeper < Formula
cp 'conf/zoo_sample.cfg', 'conf/zoo.cfg'
(etc/'zookeeper').install ['conf/zoo.cfg', 'conf/zoo_sample.cfg']
end
plist_options :manual => "zkServer start"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/zkServer</string>
<string>start-foreground</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{var}</string>
</dict>
</plist>
EOS
end
end