mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
service module: Properly disable Debian services
Services on Debian need to be disabled with 'disable' instead of 'remove' to avoid them being enabled again when 'update-rc.d $service defaults' is run, e.g. as part of a postinst script.
This commit is contained in:
parent
6221a2740f
commit
c21fa8ebee
1 changed files with 2 additions and 1 deletions
|
@ -658,7 +658,8 @@ class LinuxService(Service):
|
||||||
|
|
||||||
return self.execute_command("%s %s enable" % (self.enable_cmd, self.name))
|
return self.execute_command("%s %s enable" % (self.enable_cmd, self.name))
|
||||||
else:
|
else:
|
||||||
return self.execute_command("%s -f %s remove" % (self.enable_cmd, self.name))
|
return self.execute_command("%s %s disable" % (self.enable_cmd,
|
||||||
|
self.name))
|
||||||
|
|
||||||
# we change argument depending on real binary used:
|
# we change argument depending on real binary used:
|
||||||
# - update-rc.d and systemctl wants enable/disable
|
# - update-rc.d and systemctl wants enable/disable
|
||||||
|
|
Loading…
Reference in a new issue