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

macOS inconsistency - Status never returns "stopped" #285

Open
mpkondrashin opened this issue Jul 6, 2021 · 3 comments
Open

macOS inconsistency - Status never returns "stopped" #285

mpkondrashin opened this issue Jul 6, 2021 · 3 comments

Comments

@mpkondrashin
Copy link

For Darwin platform service Stop function use the following command:

launchctl unload <plist file path>

To get staus it uses

launchctl list <service name>

This command returns the following:

Could not find service "<service name>" in domain for system

So service Status function returns StatusUnknown event for installed but stopped service.
Result: StatusStopped is never returned.
If service library would use following command to stop the service

launchctl stop <service name>

it would not work as plist file has following key:

<key>KeepAlive</key>
<true/>

So service will restart and service.Stop function will not work.

So service Status/Stop/plist template file should be somehow changed.

@precisionpete
Copy link

Were you ever able to resolve this issue?

@mpkondrashin
Copy link
Author

No I did not. My project is cross platform and macOS is not highest priority.

@netcorevip
Copy link

netcorevip commented Apr 20, 2022

https://github.com/tjluoma/launchd-keepalive#keepalive-and-successfulexit

  <key>KeepAlive</key>
  <dict>
  <key>SuccessfulExit</key>
  <false/>
  </dict>

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