monerod: do not log to tmpdir in daemon mode
The logging to /tmp/bitmonero.daemon.stdout.stderr caused segfaults if the /tmp mount was full (#2851). Now the daemon is only logging to /tmp/bitmonero.daemon.stdout.stderr in the debug builds.
This commit is contained in:
parent
ed67e5c001
commit
496055d128
|
@ -54,6 +54,10 @@ else()
|
|||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions(-DDEBUG_TMPDIR_LOG=1)
|
||||
endif()
|
||||
|
||||
monero_private_headers(daemonizer
|
||||
${daemonizer_private_headers})
|
||||
monero_add_library(daemonizer
|
||||
|
|
|
@ -115,6 +115,7 @@ void fork(const std::string & pidfile)
|
|||
quit("Unable to open /dev/null");
|
||||
}
|
||||
|
||||
#ifdef DEBUG_TMPDIR_LOG
|
||||
// Send standard output to a log file.
|
||||
const char *tmpdir = getenv("TMPDIR");
|
||||
if (!tmpdir)
|
||||
|
@ -133,6 +134,7 @@ void fork(const std::string & pidfile)
|
|||
{
|
||||
quit("Unable to dup output descriptor");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace posix
|
||||
|
|
Loading…
Reference in New Issue