diff options
Diffstat (limited to 'Library/Formula/redis.rb')
| -rw-r--r-- | Library/Formula/redis.rb | 73 |
1 files changed, 27 insertions, 46 deletions
diff --git a/Library/Formula/redis.rb b/Library/Formula/redis.rb index 77c53e02c..9f1323583 100644 --- a/Library/Formula/redis.rb +++ b/Library/Formula/redis.rb @@ -39,53 +39,34 @@ class Redis < Formula etc.install 'redis.conf' unless (etc/'redis.conf').exist? end - def caveats - <<-EOS.undent - If this is your first install, automatically load on login with: - mkdir -p ~/Library/LaunchAgents - cp #{plist_path} ~/Library/LaunchAgents/ - launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} + plist_options :manual => "redis-server #{HOMEBREW_PREFIX}/etc/redis.conf" - 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 start redis manually: - redis-server #{etc}/redis.conf - - To access the server: - redis-cli + 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> + <true/> + <key>Label</key> + <string>#{plist_name}</string> + <key>ProgramArguments</key> + <array> + <string>#{opt_prefix}/bin/redis-server</string> + <string>#{etc}/redis.conf</string> + </array> + <key>RunAtLoad</key> + <true/> + <key>UserName</key> + <string>#{`whoami`.chomp}</string> + <key>WorkingDirectory</key> + <string>#{var}</string> + <key>StandardErrorPath</key> + <string>#{var}/log/redis.log</string> + <key>StandardOutPath</key> + <string>#{var}/log/redis.log</string> + </dict> + </plist> EOS end - - def startup_plist - return <<-EOPLIST -<?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> - <true/> - <key>Label</key> - <string>#{plist_name}</string> - <key>ProgramArguments</key> - <array> - <string>#{HOMEBREW_PREFIX}/bin/redis-server</string> - <string>#{etc}/redis.conf</string> - </array> - <key>RunAtLoad</key> - <true/> - <key>UserName</key> - <string>#{`whoami`.chomp}</string> - <key>WorkingDirectory</key> - <string>#{var}</string> - <key>StandardErrorPath</key> - <string>#{var}/log/redis.log</string> - <key>StandardOutPath</key> - <string>#{var}/log/redis.log</string> - </dict> -</plist> - EOPLIST - end end |
