diff --git a/src/App.cpp b/src/App.cpp index 39ec0d62..100d2483 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -61,13 +61,13 @@ int xmrig::App::exec() return 2; } - m_signals = std::make_shared(this); - int rc = 0; if (background(rc)) { return rc; } + m_signals = std::make_shared(this); + rc = m_controller->init(); if (rc != 0) { return rc; diff --git a/src/App_unix.cpp b/src/App_unix.cpp index b0b80079..3fde75d0 100644 --- a/src/App_unix.cpp +++ b/src/App_unix.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "App.h" @@ -53,6 +54,8 @@ bool xmrig::App::background(int &rc) return true; } + uv_loop_fork(uv_default_loop()); + i = setsid(); if (i < 0) {