mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-12 15:32:37 +02:00
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.
This commit is contained in:
@ -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])
|
||||
|
||||
|
Reference in New Issue
Block a user