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

service: More DragonFly BSD support (#40449)

- Use NetBSD's service_enable which sets the vars correctly in
  /etc/rc.conf
This commit is contained in:
Antonio Huete Jimenez 2018-05-24 00:38:10 +02:00 committed by Adam Miller
parent f88412b7cd
commit e93fbedcc7

View file

@ -1089,6 +1089,21 @@ class DragonFlyBsdService(FreeBsdService):
platform = 'DragonFly'
distribution = None
def service_enable(self):
if self.enable:
self.rcconf_value = "YES"
else:
self.rcconf_value = "NO"
rcfiles = ['/etc/rc.conf'] # Overkill?
for rcfile in rcfiles:
if os.path.isfile(rcfile):
self.rcconf_file = rcfile
self.rcconf_key = "%s" % string.replace(self.name, "-", "_")
return self.service_enable_rcconf()
class OpenBsdService(Service):
"""