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

Squashed commit of the following:

commit e057ea671395ec8847f920a63cf9524f5c8fde5f
Author: Ton Kersten <tonk@tonkersten.com>
Date:   Thu Feb 28 13:02:25 2013 +0100

    Fixed the service command not working

    On Ubuntu 1[02].04 the service name was not recognized because
    there is a SysV style init script, but not an upstart config file.

    Example: The `ntp` client.

    Also removed extra spaces at the end of the lines, while at it.
This commit is contained in:
Ton Kersten 2013-02-28 13:06:50 +01:00
parent 23bcb64758
commit 05c70ca712

View file

@ -363,6 +363,9 @@ class LinuxService(Service):
elif location.get('update-rc.d', None) and os.path.exists("/etc/init/%s.conf" % self.name): elif location.get('update-rc.d', None) and os.path.exists("/etc/init/%s.conf" % self.name):
# service is managed by upstart # service is managed by upstart
self.enable_cmd = location['update-rc.d'] self.enable_cmd = location['update-rc.d']
elif location.get('update-rc.d', None) and os.path.exists("/etc/init.d/%s" % self.name):
# service is managed by with SysV init scripts, but with update-rc.d
self.enable_cmd = location['update-rc.d']
elif location.get('systemctl', None): elif location.get('systemctl', None):
# verify service is managed by systemd # verify service is managed by systemd