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

Add -d option to fork into background as a daemon #586

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fnorkfnork
Copy link

This is useful on systems like OpenBSD which don't have a service
manager like systemd. The daemon() call is available on Linux and
OpenBSD, not sure about other systems.

This is useful on systems like OpenBSD which don't have a service
manager like systemd. The daemon() call is available on Linux and
OpenBSD, not sure about other systems.
@CLAassistant
Copy link

CLAassistant commented May 8, 2021

CLA assistant check
All committers have signed the CLA.

@Chigusa0w0
Copy link
Contributor

For portability, please avoid using daemon() if possible. Go through a standard SysV daemon creation process is recommended. Or at least include unistd.h properly when necessary.

@fnorkfnork
Copy link
Author

For portability, please avoid using daemon() if possible. Go through a standard SysV daemon creation process is recommended.

Portability to what though? I guess it's only proprietary Unixes that don't have daemon() but do have all the other POSIX APIs.

Or at least include unistd.h properly when necessary.

Yes OK. It's in stdlib.h on Mac/BSD but unistd.h on Linux.

@superbetacat
Copy link

To be honest, I like this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants