aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-12-13 19:48:11 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-12-13 19:48:11 +0000
commit7f77b23da8bd5061aba9431a6f6052fb4bd826f7 (patch)
tree1062557082fd834f22d3c5428085223882333342
parentMerge pull request #527 (diff)
downloadmonero-7f77b23da8bd5061aba9431a6f6052fb4bd826f7.tar.xz
posix_daemonizer: only create the main daemon object in the last child
This prevents the intermediate thread from exiting properly, as fork creates a child process with only one thread, so any existing data_logger thread will not be in the child. Since this thread sets a flag the data_logger dtor blocks on, all children threads will hang on exit.
-rw-r--r--src/daemonizer/posix_daemonizer.inl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/daemonizer/posix_daemonizer.inl b/src/daemonizer/posix_daemonizer.inl
index c07b96c55..5675fd72d 100644
--- a/src/daemonizer/posix_daemonizer.inl
+++ b/src/daemonizer/posix_daemonizer.inl
@@ -74,9 +74,9 @@ namespace daemonizer
{
if (command_line::has_arg(vm, arg_detach))
{
- auto daemon = executor.create_daemon(vm);
tools::success_msg_writer() << "Forking to background...";
posix::fork();
+ auto daemon = executor.create_daemon(vm);
return daemon.run();
}
else