homebrew-bundle icon indicating copy to clipboard operation
homebrew-bundle copied to clipboard

Gracefully start services that aren't running

Open jeremy opened this issue 3 years ago • 1 comments

When start_service: true, install starts the service if it isn't running, whether or not it was installed.

Aligns with check which expects a formula with start_service: true to have a running service.

This is possible with restart_service: true, but that always restarts the service which is needlessly disruptive when it's already running and hasn't been upgraded.

Restarts can be avoided with brew bundle check || brew bundle install in tandem with restart_service: true, but that's drifting from "Just Works" to fairly arcane.

brew bundle dump is updated to reflect graceful service changes. They're now dumped with start_service: true, restart_service: :changed instead of restart_service: true so brew bundle install will just keep the service running and up-to-date.

Ideally, this would be the default for any formulae with a service: they'd be started and updated by default with no additional config. Formulae with optional services would use start_service: false to turn them off. This updates the dumper to anticipate such a change and dump formulae with services that aren't running as start_service: false.

In the meantime, restart_service: :changed could imply start_service: true, matching our intuition that the service should be running.

References #188, #204

jeremy avatar Aug 19 '22 21:08 jeremy

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Sep 13 '22 00:09 github-actions[bot]

Argh - broke actual usage due to stubbing BrewServices.start but not adding the implementation. 🤦🏼‍♂️

Fixed in #1129

jeremy avatar Oct 03 '22 15:10 jeremy