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.
- Removes the fallback path for operating systems that support daemonization but not
daemon(). This prevents never-exercised code from ending up in the repository (see discussion here: #8278 (comment)). - Removes the windows-specific path. Windows doesn’t support
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. - Also made showing the help message depend on
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..”.