mirror of
https://github.com/monero-project/monero.git
synced 2024-11-17 16:27:39 +00:00
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.
This commit is contained in:
parent
e175205e6e
commit
7f77b23da8
1 changed files with 1 additions and 1 deletions
|
@ -74,9 +74,9 @@ namespace daemonizer
|
||||||
{
|
{
|
||||||
if (command_line::has_arg(vm, arg_detach))
|
if (command_line::has_arg(vm, arg_detach))
|
||||||
{
|
{
|
||||||
auto daemon = executor.create_daemon(vm);
|
|
||||||
tools::success_msg_writer() << "Forking to background...";
|
tools::success_msg_writer() << "Forking to background...";
|
||||||
posix::fork();
|
posix::fork();
|
||||||
|
auto daemon = executor.create_daemon(vm);
|
||||||
return daemon.run();
|
return daemon.run();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue