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
15bf8a83
Commit
15bf8a83
authored
Jun 30, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3315 from madduck/fix-service-updatercd-changed
Let update-rc.d set changed flag properly
parents
39105dc8
85b8538e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
library/system/service
+22
-3
No files found.
library/system/service
View file @
15bf8a83
...
...
@@ -547,6 +547,27 @@ class LinuxService(Service):
if
not
self
.
enable
:
return
if
self
.
enable_cmd
.
endswith
(
"update-rc.d"
):
if
self
.
enable
:
action
=
'enable'
else
:
action
=
'disable'
(
rc
,
out
,
err
)
=
self
.
execute_command
(
"
%
s -n
%
s
%
s"
\
%
(
self
.
enable_cmd
,
self
.
name
,
action
))
self
.
changed
=
False
for
line
in
out
.
splitlines
():
if
line
.
startswith
(
'rename'
):
self
.
changed
=
True
break
if
self
.
module
.
check_mode
:
self
.
module
.
exit_json
(
changed
=
changed
)
if
not
self
.
changed
:
return
return
self
.
execute_command
(
"
%
s
%
s
%
s"
%
(
self
.
enable_cmd
,
self
.
name
,
action
))
# we change argument depending on real binary used:
# - update-rc.d and systemctl wants enable/disable
# - chkconfig wants on/off
...
...
@@ -561,9 +582,7 @@ class LinuxService(Service):
enable_disable
=
"disable"
add_delete
=
"delete"
if
self
.
enable_cmd
.
endswith
(
"update-rc.d"
):
args
=
(
self
.
enable_cmd
,
self
.
name
,
enable_disable
)
elif
self
.
enable_cmd
.
endswith
(
"rc-update"
):
if
self
.
enable_cmd
.
endswith
(
"rc-update"
):
args
=
(
self
.
enable_cmd
,
add_delete
,
self
.
name
+
" "
+
self
.
runlevel
)
elif
self
.
enable_cmd
.
endswith
(
"systemctl"
):
args
=
(
self
.
enable_cmd
,
enable_disable
,
self
.
name
+
".service"
)
...
...
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