diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2021-01-25 22:45:54 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2021-03-04 18:24:00 +0100 |
commit | e017a913d0d78ef0766cf73586fe7a38488e1a26 (patch) | |
tree | f5d47c98db9c0c32c59a0f08aaeb6aaed75dbe70 /configure.ac | |
parent | c3e6fdee6d39d3f52dec421b48a0ac8bad5006f7 (diff) |
bitcoind: Add -daemonwait option to wait for initialization
This adds a `-daemonwait` flag that does the same as `-daemon` except
it, from a user perspective, backgrounds the process only after
initialization is complete.
This can be useful when the process launching bitcoind wants to
guarantee that either the RPC server is running, or that initialization
failed, before continuing. The exit code indicates the initialization
result.
This replaces the use of the libc function `daemon()` by a custom
implementation which is inspired by the glibc implementation, but also
creates a pipe from the child to the parent process for communication.
An additional advantage of having our own `daemon()` implementation is
that no MACOS-specific pragmas are needed anymore to silence a
deprecation warning.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index d99f5dd8ae..3b318cb2df 100644 --- a/configure.ac +++ b/configure.ac @@ -922,8 +922,9 @@ AC_CHECK_DECLS([getifaddrs, freeifaddrs],,, ) AC_CHECK_DECLS([strnlen]) -dnl Check for daemon(3), unrelated to --with-daemon (although used by it) -AC_CHECK_DECLS([daemon]) +dnl These are used for daemonization in bitcoind +AC_CHECK_DECLS([fork]) +AC_CHECK_DECLS([setsid]) AC_CHECK_DECLS([pipe2]) |