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

service: launch only once #12837

Merged
merged 4 commits into from
Feb 14, 2022

Conversation

NickHackman
Copy link

@NickHackman NickHackman commented Feb 4, 2022

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This change adds a MacOS launchctl configuration to services that allows providing the LaunchOnlyOnce boolean flag.

     LaunchOnlyOnce <boolean>
     This optional key specifies whether the job can only be run once and only once.  In other words, if the job cannot be safely
     respawned without a full machine reboot, then set this key to be true.

NOTE: this is MacOS only, if there's a way to provide this for systemd that'd be awesome!

Issue: abiosoft/colima#96

@NickHackman NickHackman force-pushed the service-launch-only-once branch 2 times, most recently from f28d43a to e86a4c5 Compare February 5, 2022 03:32
@SMillerDev
Copy link
Member

@carlocab
Copy link
Member

carlocab commented Feb 7, 2022

man launchd.plist:

     LaunchOnlyOnce <boolean>
     This optional key specifies whether the job can only be run once and only once.  In other words, if the job cannot be safely
     respawned without a full machine reboot, then set this key to be true.

@SMillerDev
Copy link
Member

Additionally, I think Type=oneshot would be the systemd equivalent.

@NickHackman NickHackman force-pushed the service-launch-only-once branch from f0aad4d to a7c427a Compare February 11, 2022 20:48
Set the type of service to oneshot if launch_only_once is provided; otherwise, simple.
@NickHackman NickHackman force-pushed the service-launch-only-once branch from a7c427a to 53d37cc Compare February 12, 2022 22:26
@NickHackman NickHackman marked this pull request as ready for review February 12, 2022 22:46
@MikeMcQuaid MikeMcQuaid merged commit 249bc21 into Homebrew:master Feb 14, 2022
@MikeMcQuaid
Copy link
Member

Thanks so much for your first contribution to Homebrew! Without people like you submitting PRs we couldn't run this project. You rock, @NickHackman!

@github-actions github-actions bot added the outdated PR was locked due to age label Mar 17, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants