From eff2c548cdca711375caa9200b3bd86cba30efb7 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Tue, 23 Apr 2024 15:41:01 -0500 Subject: [PATCH] Add List All Services Managed By Brew as a Brew TIL --- README.md | 3 ++- brew/list-all-services-managed-by-brew.md | 28 +++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 brew/list-all-services-managed-by-brew.md diff --git a/README.md b/README.md index 9b9c94a..0c9107b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1416 TILs and counting..._ +_1417 TILs and counting..._ --- @@ -99,6 +99,7 @@ _1416 TILs and counting..._ ### Brew - [Configure Brew Environment Variables](brew/configure-brew-environment-variables.md) +- [List All Services Managed By Brew](brew/list-all-services-managed-by-brew.md) ### Chrome diff --git a/brew/list-all-services-managed-by-brew.md b/brew/list-all-services-managed-by-brew.md new file mode 100644 index 0000000..00b78f4 --- /dev/null +++ b/brew/list-all-services-managed-by-brew.md @@ -0,0 +1,28 @@ +# List All Services Managed By Brew + +Daemonized services, such as PostgreSQL, can be installed and managed with +Homebrew. Under the hood `brew` uses `launchctl` on Mac to manage these +services — i.e. starting, restarting, and stopping them. + +Assuming you've already installed some services, you can run `brew services +list` to see what services there are and what their current status is. + +```bash +$ brew services list +Name Status User File +mailhog none +mysql none +postgresql@11 started jbranchaud ~/Library/LaunchAgents/homebrew.mxcl.postgresql@11.plist +postgresql@13 none +postgresql@16 none +unbound none +``` + +This is the default behavior if you just run `brew services` without a subcommand. + +This is helpful if you are, for instance, trying to see which PostgreSQL server +version you are currently running and which other ones are available to run. I +might then issue a `stop` to `postgresql@11` so that I can then `start` the +`postgresql@16` service. + +See `brew services --help` for more details.