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

Explanation of launchd: concepts' ambiguity #1

Open
scrutinizer11 opened this issue Sep 9, 2020 · 0 comments
Open

Explanation of launchd: concepts' ambiguity #1

scrutinizer11 opened this issue Sep 9, 2020 · 0 comments

Comments

@scrutinizer11
Copy link

scrutinizer11 commented Sep 9, 2020

Hello,

I read your summary on KeepAlive and RunAtLoad properties and found some grey places that I felt needed clarification. I base my assumptions on an article at https://www.launchd.info and they address what you tried to explain about how the sub-keys "SuccessfulExit" and "NetworkState" affect the parent "KeepAlive" property. You wrote

If an app exits "successfully" (technically, with an exit code = 0) then the app will not be automatically restarted (kept > alive). However, if the app crashes (exit code not equal to 0) then it will be automatically restarted.

As per the explanation in the linked article, "SuccessfulExit" alters the behaviour of the job that's going to be kept alive anyway with the caveat that if the boolean value is TRUE it will be restarted until it fails, and if the boolean is FALSE it will be restarted until it succeeds. So, in both cases, the job will run.
The same is true for "NetworkState": if TRUE then the job will run while or when the connection is up. If FALSE it will run while or when the connection is down.
So your last sentence of those I quoted should've been

If an app exits "successfully" (technically, with an exit code = 0) then the app will be automatically restarted until it fails with non-zero exit code.

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

1 participant