1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fixes corner case for systemd services

when both unit file and sysv init script exist
Thanks to @olfway for fix.

fixes #3764
This commit is contained in:
Brian Coca 2016-08-11 09:23:32 -04:00 committed by Matt Clay
parent fe273a4e09
commit 3c89a21e0c

View file

@ -496,6 +496,8 @@ class LinuxService(Service):
(rc, out, err) = self.execute_command("%s is-enabled %s" % (self.enable_cmd, service_name,))
if rc == 0:
return True
elif out.startswith('disabled'):
return False
elif sysv_exists(service_name):
return sysv_is_enabled(service_name)
else: