Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew services should never store services on external drives on Mac #862

Closed
rgaufman opened this issue Jan 3, 2025 · 5 comments
Closed

Comments

@rgaufman
Copy link

rgaufman commented Jan 3, 2025

Sorry, I didn't describe the issue well previously.

launchctl cannot start services from external drives.

brew services should never store services there as this will lead to the services not being able to start.

brew services should instead check if the home directory is on the internal drive, if not, it should store services in /opt/homebrew/ - otherwise services are broken for the fairly large and growing number of desktop Mac users with home directories on external drives.

@SMillerDev
Copy link
Member

it should store services in /opt/homebrew/ - otherwise services are broken

There is a version of the service installed with the formula iirc. But brew services will move the file to the location that Apple documents for it.

It won't run from other locations as far as I know, so I think we'll just need to block the command if we detect an external drive.

for the fairly large percentage of Mac users with home directories on external drives.

I'm curious why you think this is the case, because as far as I know you're the first person to complain about this type of setup.

@rgaufman
Copy link
Author

rgaufman commented Jan 3, 2025

Just for reference, there was a similar report in 2021: GitHub Issue #321.

That said, things have changed a bit since then. With the M4 Mac Mini priced at £470 and Apple’s storage upgrades being extremely expensive (a modest upgrade costs as much as 2 base model Mac Minis), a lot of users are opting for the base model and moving their home directories to external drives.

The sales figures for the base model are very high, and anecdotally, I’ve seen many bug reports on other projects and forum threads trying to run launchctl and needing to move the service files to the internal drive. There are many recent YouTube videos too explaining how to set up home directories on external drives. It’s becoming a fairly common workaround for the steep internal storage pricing.

@SMillerDev
Copy link
Member

That all seems pretty speculative, especially since there are only two people who ran into this with homebrew.

I'll happily review a pull request to add support, but I don't think I'll be volunteering time for it.

@rgaufman
Copy link
Author

rgaufman commented Jan 4, 2025

That's fair, I'll have a look at this in the coming few days.

Separately, if you are on a desktop Mac with sub 1TB storage, moving your home directory to an external drive is pretty game changing, loads of videos about this, some examples:

  1. https://www.youtube.com/watch?v=WtIbGq6Od6o
  2. https://www.youtube.com/watch?v=9cdim4v_0Kg
  3. https://www.youtube.com/watch?v=DLsHMdKQ-yo
  4. https://www.youtube.com/watch?v=doz85F-Ch8Q
  5. https://www.youtube.com/watch?v=5e7qb_ChuHE

@rgaufman
Copy link
Author

rgaufman commented Jan 7, 2025

I discovered there is actually a simple solution for this, it's described here: https://bjango.com/help/istatmenus7/permissionshome/

Basically in Finder, on the external drive you untick "ignore ownership":
image

Followed by:

sudo chown -R "$(id -un):$(id -gn)" ~/Library/LaunchAgents/

Then services start as expected on the external volume!

@rgaufman rgaufman closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@SMillerDev @rgaufman and others