毎回立ち上げるのが面倒だったので設定した時のメモ
環境:
- OSX: v10.12.3
- rbenv: 1.1.0-2-g4f8925a
前提:
rbenv はユーザーにインストールしてる
参考:
- https://gist.github.com/nebiros/2776085
- http://serverfault.com/questions/111391/use-an-environment-variable-in-a-launchd-script
- http://paulownia.hatenablog.com/entry/2013/03/09/202949
実行コマンド
gem install fakes3
cat << EOS > ~/Library/LaunchAgents/homebrew.mxcl.fakes3.plist
<?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>homebrew.mxcl.fakes3</string>
<key>ProgramArguments</key>
<array>
<string>/Users/$USER/.rbenv/shims/fakes3</string>
<string>-r</string>
<string>/usr/local/var/fakes3</string>
<string>-p</string>
<string>4567</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/var</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/fakes3.log</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/fakes3.log</string>
</dict>
</plist>
EOS
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.fakes3.plist