Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
81418afb
Commit
81418afb
authored
May 04, 2012
by
Seth Vidal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix up service module to make it start processes that are listed to be
running and to report errors from starting them
parent
b300aac5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
library/service
+5
-5
No files found.
library/service
View file @
81418afb
...
...
@@ -138,9 +138,9 @@ status = status_stdout + status_stderr
running
=
False
if
status_stdout
.
find
(
"
not running"
)
!=
-
1
:
if
status_stdout
.
find
(
"
stopped"
)
!=
-
1
or
rc
==
3
:
running
=
False
elif
status_stdout
.
find
(
"running"
)
!=
-
1
:
elif
status_stdout
.
find
(
"running"
)
!=
-
1
or
rc
==
0
:
running
=
True
elif
name
==
'iptables'
and
status_stdout
.
find
(
"ACCEPT"
)
!=
-
1
:
# iptables status command output is lame
...
...
@@ -165,7 +165,7 @@ if state or enable:
# ===========================================
# determine if we are going to change anything
if
not
running
and
state
==
"started"
:
if
not
running
and
state
in
(
"started"
,
"running"
)
:
changed
=
True
elif
running
and
state
==
"stopped"
:
changed
=
True
...
...
@@ -183,13 +183,13 @@ if state or enable:
elif
state
==
'restarted'
:
rc1
,
stdout1
,
stderr1
=
_run
(
"
%
s
%
s stop"
%
(
SERVICE
,
name
))
rc2
,
stdout2
,
stderr2
=
_run
(
"
%
s
%
s start"
%
(
SERVICE
,
name
))
rc_state
=
rc
and
rc1
and
rc2
rc_state
=
rc
+
rc1
+
rc2
stdout
=
stdout1
+
stdout2
stderr
=
stderr1
+
stderr2
out
+=
stdout
err
+=
stderr
rc
=
rc
and
rc_state
rc
=
rc
+
rc_state
if
rc
!=
0
:
...
...
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