Managing Homebrew Services


Posted by Andrew McCombe on Fri Aug 5, 2016

If you’re using a Mac for developmement you probably use Homebrew to install software dependencies for your web applications (and if you’re not, you should). Homebrew is easy to use and makes installing services such as MySQL, Elasticsearch, and Beanstalkd a breeze. Managing Homebrew services is also a cinch. Here’s how.

Listing Services

You can get a list of all installed services and their current status by running brew services list:

brew-services-list

Starting, Stopping, and Reloading Services

To start a service you would use brew services start <servicename>. For example, to start Elasticsearch you would enter brew services start elasticsearch:

brew-services-start-elasticsearch

To stop a service you would use the stop command:

brew services stop elasticsearch

Restarting a service is similar, use the restart command:

brew services restart elasticsearch

Cleaning up services

Homebrew also provides a command to help cleanup any unused services:

brew services cleanup

When I ran this on my machine it told me that Beanstalkd was a stale service and it removed the plist for that service.