brewでインストールしたサービス、いつもlaunchctl
使って、ググりながら
起動
$ launchctl load -w ~/Library/LaunchAgents/xxx.plist
停止
$ launchctl unload -w ~/Library/LaunchAgents/xxx.plist
をやっていたけど、brew service
コマンド使えばよかた・・
起動
$ brew services start xxx
停止
$ brew services stop xxx
その他
$ brew services --help
usage: [sudo] brew services [--help] <command> [<formula>]
Small wrapper around `launchctl` for supported formulae, commands available:
cleanup Get rid of stale services and unused plists
list List all services managed by `brew services`
restart Gracefully restart selected service
start Start selected service
stop Stop selected service
Options, sudo and paths:
sudo When run as root, operates on /Library/LaunchDaemons (run at boot!)
Run at boot: /Library/LaunchDaemons
Run at login: /Users/maki/Library/LaunchAgents
http://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew