From dbf7a6ab29348c101c11f88aba68fadc9a645fc6 Mon Sep 17 00:00:00 2001 From: dmitry <dmitry.puzyrkov@demlabs.net> Date: Thu, 25 Jul 2024 11:47:55 +0700 Subject: [PATCH] [*] linux service use fix --- conftool/service/service_linux.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conftool/service/service_linux.cpp b/conftool/service/service_linux.cpp index b8a620773..fe2928f88 100644 --- a/conftool/service/service_linux.cpp +++ b/conftool/service/service_linux.cpp @@ -4,7 +4,7 @@ #include "../commands/abstractcommand.h" bool CServiceControl::enable(){ - std::string cmd = "systemctl enable " + variable_storage["SERVICE_FILE_PATH"] + " > /dev/null"; + std::string cmd = "systemctl enable " + (std::filesystem::path{variable_storage["CONFIGS_PATH"]}/"share"/"cellframe-node.service > /dev/null").string(); int res = std::system(cmd.c_str()); return res == 0 ? true : false; @@ -12,7 +12,7 @@ bool CServiceControl::enable(){ bool CServiceControl::disable() { - std::string cmd = "systemctl disable " + variable_storage["SERVICE_NAME"] +" > /dev/null"; + std::string cmd = "systemctl disable cellframe-node.service > /dev/null"; int res = std::system(cmd.c_str()); return res == 0 ? true : false; } @@ -21,7 +21,7 @@ unsigned int CServiceControl::serviceStatus() { unsigned int status = 0; - std::string cmd = "systemctl is-enabled " + variable_storage["SERVICE_NAME"] + " > /dev/null"; + std::string cmd = "systemctl is-enabled cellframe-node.service > /dev/null"; int res = std::system(cmd.c_str()); if (res == 0) @@ -42,21 +42,21 @@ unsigned int CServiceControl::serviceStatus() bool CServiceControl::start() { - std::string cmd = "systemctl start " + variable_storage["SERVICE_NAME"] + " > /dev/null"; + std::string cmd = "systemctl start cellframe-node.service > /dev/null"; int res = std::system(cmd.c_str()); return res == 0 ? true : false; } bool CServiceControl::stop() { - std::string cmd = "systemctl stop " + variable_storage["SERVICE_NAME"] + " > /dev/null"; + std::string cmd = "systemctl stop cellframe-node.service > /dev/null"; int res = std::system(cmd.c_str()); return res == 0 ? true : false; } bool CServiceControl::restart() { - std::string cmd = "systemctl restart " + variable_storage["SERVICE_NAME"] + " > /dev/null"; + std::string cmd = "systemctl restart cellframe-node.service > /dev/null"; int res = std::system(cmd.c_str()); return res == 0 ? true : false; } -- GitLab