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

LinuxService: avoid enforcing systemd even if init.d script was found

This commit is contained in:
Elan Ruusamäe 2013-05-11 13:22:07 +03:00
parent 8ef18c2f98
commit 6949a9fbe4

View file

@ -390,7 +390,7 @@ class LinuxService(Service):
break break
# Locate a tool for runtime service management (start, stop etc.) # Locate a tool for runtime service management (start, stop etc.)
self.svc_cmd = '' self.svc_cmd = None
if location.get('service', None) and os.path.exists("/etc/init.d/%s" % self.name): if location.get('service', None) and os.path.exists("/etc/init.d/%s" % self.name):
# SysV init script # SysV init script
self.svc_cmd = location['service'] self.svc_cmd = location['service']
@ -405,7 +405,7 @@ class LinuxService(Service):
self.svc_initscript = initscript self.svc_initscript = initscript
# couldn't find anything yet, assume systemd # couldn't find anything yet, assume systemd
if self.svc_initscript is None: if self.svc_cmd is None and self.svc_initscript is None:
if location.get('systemctl'): if location.get('systemctl'):
self.svc_cmd = location['systemctl'] self.svc_cmd = location['systemctl']