Skip to content

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

Open
fnorkfnork wants to merge 2 commits into
trojan-gfw:masterfrom
fnorkfnork:daemon
Open

Add -d option to fork into background as a daemon#586
fnorkfnork wants to merge 2 commits into
trojan-gfw:masterfrom
fnorkfnork:daemon

Conversation

@fnorkfnork
Copy link
Copy Markdown

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
Copy Markdown

CLAassistant commented May 8, 2021

CLA assistant check
All committers have signed the CLA.

@Chigusa0w0
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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.

4 participants