Skip to content
Snippets Groups Projects
Commit dbf7a6ab authored by Dmitry Puzyrkov's avatar Dmitry Puzyrkov
Browse files

[*] linux service use fix

parent e6136d6f
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment