Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
78de5d3a
Commit
78de5d3a
authored
Feb 12, 2019
by
Дмитрий Никулин
Committed by
Никита Ефремов
Apr 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for system service statuses on Ubuntu
parent
6f12aecb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
fmod_system_services.py
plugins/functions/fmod_system_services.py
+5
-2
process.py
settingsd/tools/process.py
+1
-1
No files found.
plugins/functions/fmod_system_services.py
View file @
78de5d3a
...
...
@@ -92,7 +92,9 @@ class SystemService(service.FunctionObject) :
@service.functionMethod
(
SYSTEM_SERVICE_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
status
(
self
)
:
proc_args_list
=
[
"serv"
,
self
.
__system_service_name
,
"status"
]
proc_args_list
=
[
config
.
value
(
SERVICE_NAME
,
"serv_mgr_command"
),
self
.
__system_service_name
,
"status"
]
return
tools
.
process
.
execProcess
(
proc_args_list
,
fatal_flag
=
False
)[
2
]
...
...
@@ -189,7 +191,8 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
def
options
(
self
)
:
return
[
(
SERVICE_NAME
,
"initd_dir"
,
"/etc/rc.d/init.d"
,
str
),
(
SERVICE_NAME
,
"chkconfig_bin"
,
"/sbin/chkconfig"
,
str
)
(
SERVICE_NAME
,
"chkconfig_bin"
,
"/sbin/chkconfig"
,
str
),
(
SERVICE_NAME
,
"serv_mgr_command"
,
"serv"
,
str
)
]
...
...
settingsd/tools/process.py
View file @
78de5d3a
...
...
@@ -37,8 +37,8 @@ def execProcess(proc_args_list, proc_input = None, fatal_flag = True,
error_text
=
"Error while execute
\"
%
s
\"\n
Stdout:
%
s
\n
Stderr:
%
s
\n
Stdin:
%
s
\n
Return code:
%
d"
%
(
str
(
proc_args_list
),
proc_stdout
.
strip
(),
proc_stderr
.
strip
(),
proc_input
,
proc
.
returncode
)
if
fatal_flag
:
logger
.
error
(
"{submod}: "
+
error_text
)
raise
SubprocessFailure
(
error_text
)
logger
.
error
(
"{submod}: "
+
error_text
)
logger
.
debug
(
"{submod}: Child process
\"
%
s
\"
finished, return_code=
%
d"
%
(
str
(
proc_args_list
),
proc
.
returncode
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment