mac homebrew起動サービス
1572 ワード
you can install the soft with brew install softname
eg:brew install mysql
or search soft with
brew search softname
eg: brew search mysql
these services will install at/usr/local/opt
In OS X, these services are represented by files ending with .plist.
these plists are usually stored in either ~/Library/LaunchAgents or
/Library/LaunchAgents.
for example:
you can load mysql as followed:
ln -sfv/usr/local/opt/mysql/*.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want launchctl, you can just run:
mysql.server start
Doing all that takes too long, and I can never remember where Homebrew plists are. Fortunately, Homebrew includes a lovely interface for managing this without using
brew services
here is an example usage:
➜
brew services start mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
you can restart it like this:
brew services restart mysql
or stop it:
brew services stop mysql
now, let's see evey service we've loaded:
brew services list
Name Status User Plist
mysql started xiezhenjia/Users/xiezhenjia/Library/LaunchAgents/homebrew.mxcl.mysql.plist
redis started xiezhenjia/Users/xiezhenjia/Library/LaunchAgents/homebrew.mxcl.redis.plist
if there is some unusable plist you can run
brew services cheanup to remove them.
eg:brew install mysql
or search soft with
brew search softname
eg: brew search mysql
these services will install at/usr/local/opt
In OS X, these services are represented by files ending with .plist.
these plists are usually stored in either ~/Library/LaunchAgents or
/Library/LaunchAgents.
for example:
you can load mysql as followed:
ln -sfv/usr/local/opt/mysql/*.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want launchctl, you can just run:
mysql.server start
Doing all that takes too long, and I can never remember where Homebrew plists are. Fortunately, Homebrew includes a lovely interface for managing this without using
ln
, launchctl
or knowing where plists are. brew services
here is an example usage:
➜
brew services start mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
you can restart it like this:
brew services restart mysql
or stop it:
brew services stop mysql
now, let's see evey service we've loaded:
brew services list
Name Status User Plist
mysql started xiezhenjia/Users/xiezhenjia/Library/LaunchAgents/homebrew.mxcl.mysql.plist
redis started xiezhenjia/Users/xiezhenjia/Library/LaunchAgents/homebrew.mxcl.redis.plist
if there is some unusable plist you can run
brew services cheanup to remove them.