mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
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
2 changed files with 6 additions and 0 deletions
|
@ -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 a new issue