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

question: why exit(0)when parent pid is 1? #3

Open
PoiScript opened this issue Mar 19, 2024 · 2 comments
Open

question: why exit(0)when parent pid is 1? #3

PoiScript opened this issue Mar 19, 2024 · 2 comments

Comments

@PoiScript
Copy link

Hello, I was trying to run my SketchyBarHelper as a launch agent. But i'm encountering a problem that the helper exits if its parent pid equal to 1 (which is launchd). I found out this behavior was introduced by this commit 73ee34d for handling kill signals, but I don't have any detail or context about this change. It's there any workaround to run the helper by launchd?

@FelixKratz
Copy link
Owner

The idea is that the helper should never become an orphan, i.e. its ppid should not be 1 if it was not already initially. This ensures that the helper exits once the parent process does. Maybe its better to do a startup check for the ppid and only branch into the exit branch if the ppid has changed to 1.

@PoiScript
Copy link
Author

@FelixKratz thank you for the explanation! I just moved the helper command to the bottom of sketchybarrc instead, so the helper can be launched at startup eventually. But I'm unsure if keeping a long-running job within sketchybarrc is recommended.

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

2 participants