Skip to content

Instantly share code, notes, and snippets.

@noma4i
Forked from subfuzion/redis-autostart-osx.md
Created March 21, 2016 22:04
Show Gist options
  • Save noma4i/8d471a91b3aeb8bfe3c3 to your computer and use it in GitHub Desktop.
Save noma4i/8d471a91b3aeb8bfe3c3 to your computer and use it in GitHub Desktop.
redis auto start OS X

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)

You can use launchctl to start and stop redis

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

You can also more conveniently use brew to start, stop, and verify service status

$ brew services list | grep redis
$ brew services start redis
$ brew services stop redis

Notes

The default plist provided by homebrew stores the redis configuration at /usr/local/etc/redis.conf.

For more about launchctl see:

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/launchctl.1.html#//apple_ref/doc/man/1/launchctl

http://launchd.info/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment