From 496055d12871eca27b024fd2f746a8e5d07e5714 Mon Sep 17 00:00:00 2001 From: ston1th Date: Tue, 13 Feb 2018 19:54:49 +0100 Subject: [PATCH 1/2] 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. --- src/daemonizer/CMakeLists.txt | 4 ++++ src/daemonizer/posix_fork.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/daemonizer/CMakeLists.txt b/src/daemonizer/CMakeLists.txt index 2c0583c49..2753d0003 100644 --- a/src/daemonizer/CMakeLists.txt +++ b/src/daemonizer/CMakeLists.txt @@ -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 diff --git a/src/daemonizer/posix_fork.cpp b/src/daemonizer/posix_fork.cpp index 4dff04f3f..3cbee9c51 100644 --- a/src/daemonizer/posix_fork.cpp +++ b/src/daemonizer/posix_fork.cpp @@ -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 From 6d900a40d9dbddda5474757600212101e9e78e58 Mon Sep 17 00:00:00 2001 From: ston1th Date: Fri, 23 Feb 2018 21:28:08 +0100 Subject: [PATCH 2/2] removed systemd private tempdir --- utils/systemd/monerod.service | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/systemd/monerod.service b/utils/systemd/monerod.service index b6b6b6ce6..696be4c33 100644 --- a/utils/systemd/monerod.service +++ b/utils/systemd/monerod.service @@ -15,7 +15,6 @@ ExecStart=/usr/bin/monerod --config-file /etc/monerod.conf \ --detach --pidfile /run/monero/monerod.pid Restart=always -PrivateTmp=true [Install] WantedBy=multi-user.target