mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-24 06:07:46 +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()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
add_definitions(-DDEBUG_TMPDIR_LOG=1)
|
||||||
|
endif()
|
||||||
|
|
||||||
monero_private_headers(daemonizer
|
monero_private_headers(daemonizer
|
||||||
${daemonizer_private_headers})
|
${daemonizer_private_headers})
|
||||||
monero_add_library(daemonizer
|
monero_add_library(daemonizer
|
||||||
|
|
|
@ -115,6 +115,7 @@ void fork(const std::string & pidfile)
|
||||||
quit("Unable to open /dev/null");
|
quit("Unable to open /dev/null");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_TMPDIR_LOG
|
||||||
// Send standard output to a log file.
|
// Send standard output to a log file.
|
||||||
const char *tmpdir = getenv("TMPDIR");
|
const char *tmpdir = getenv("TMPDIR");
|
||||||
if (!tmpdir)
|
if (!tmpdir)
|
||||||
|
@ -133,6 +134,7 @@ void fork(const std::string & pidfile)
|
||||||
{
|
{
|
||||||
quit("Unable to dup output descriptor");
|
quit("Unable to dup output descriptor");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace posix
|
} // namespace posix
|
||||||
|
|
Loading…
Reference in a new issue