Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
celllframe-node
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Code
Merge requests
15
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
celllframe-node
Commits
dbf7a6ab
Commit
dbf7a6ab
authored
8 months ago
by
Dmitry Puzyrkov
Browse files
Options
Downloads
Patches
Plain Diff
[*] linux service use fix
parent
e6136d6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
conftool/service/service_linux.cpp
+6
-6
6 additions, 6 deletions
conftool/service/service_linux.cpp
with
6 additions
and
6 deletions
conftool/service/service_linux.cpp
+
6
−
6
View file @
dbf7a6ab
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment