Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
bitcoind: Daemonize using daemon(3) #8813
Conversation
laanwj
added
the
Utils and libraries
label
Sep 26, 2016
| - if (pid < 0) | ||
| - { | ||
| - fprintf(stderr, "Error: fork() returned %d errno %d\n", pid, errno); | ||
| + // daemon(3) basically does exactly what follows in the else block, |
laanwj
changed the title from
bitcoind: Daemonise using daemon(3)
to
bitcoind: Daemonize using daemon(3)
Sep 26, 2016
jonasschnelli
approved these changes
Sep 26, 2016
|
Tested ACK (OSX) a92bf4a. |
|
Possibly related: #4676 (haven't checked) |
|
Concept ACK. |
laanwj
merged commit a92bf4a
into
bitcoin:master
Sep 30, 2016
1 check passed
added a commit
that referenced
this pull request
Sep 30, 2016
|
Note: if you end up here seeing the "Error: -daemon is not supported on this operating system" message while your OS does support it, this most likely means you need to re-run autogen.sh and configure. |
|
This brings new warning on OS X:
|
|
You can't be friggin serious. |
|
@paveljanik Just curious do they suggest anything to use instead of daemon? |
|
I wouldn't take the deprecation warning to serious. |
|
Apparently they recommend doing something Apple-specific with plists and such https://developer.apple.com/library/content/technotes/tn2083/_index.html#//%20apple_ref/doc/uid/DTS10003794-CH1-SUBSECTION64 |
|
I agree with @jonasschnelli. No need to revert this. This only shows how Apple deprecates stuff. What is the current status of daemon in the current macOS? |

laanwj commentedSep 26, 2016
•
Edited 1 time
-
laanwj
Sep 26, 2016
Simplified version of #8278. Assumes that every OS that (a) is supported by Bitcoin Core (b) supports daemonization has the
daemon()function in its C library.daemon(). This prevents never-exercised code from ending up in the repository (see discussion here:#8278 (comment)).
daemon(), so it doesn't support daemonization there, automatically. Give an explicit error if a user specifies-daemonon an OS where this is not supported.HAVE_DECL_DAEMONinstead of!WIN32.The original problem reported in #8278 was "When started with cron, the sendmail process hung around waiting for its stdin, bitcoind's stdout/err, to close..".