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

fixed bsd service_mgr_facts using removed check_init fucntion

This commit is contained in:
Brian Coca 2015-11-03 11:43:50 -05:00
parent e667c0af0d
commit 8d3da20302

View file

@ -562,12 +562,8 @@ class Facts(object):
else: else:
self.facts['service_mgr'] = 'systemstarter' self.facts['service_mgr'] = 'systemstarter'
elif self.facts['system'].endswith('BSD') or self.facts['system'] in ['Bitrig', 'DragonFly']: elif self.facts['system'].endswith('BSD') or self.facts['system'] in ['Bitrig', 'DragonFly']:
proc_1 = check_init() #FIXME: we might want to break out to individual BSDs
if proc_1 is not None: self.facts['service_mgr'] = 'bsdinit'
self.facts['service_mgr'] = proc_1
else:
#FIXME: we might want to break out to individual BSDs
self.facts['service_mgr'] = 'bsdinit'
elif self.facts['system'] == 'AIX': elif self.facts['system'] == 'AIX':
self.facts['service_mgr'] = 'src' self.facts['service_mgr'] = 'src'
elif self.facts['system'] == 'SunOS': elif self.facts['system'] == 'SunOS':
@ -701,7 +697,7 @@ class Facts(object):
# tools must be installed # tools must be installed
if module.get_bin_path('systemctl'): if module.get_bin_path('systemctl'):
# this should show if systemd is the boot init system, if check_init faild to mark as systemd # this should show if systemd is the boot init system, if checking init faild to mark as systemd
# these mirror systemd's own sd_boot test http://www.freedesktop.org/software/systemd/man/sd_booted.html # these mirror systemd's own sd_boot test http://www.freedesktop.org/software/systemd/man/sd_booted.html
for canary in ["/run/systemd/system/", "/dev/.run/systemd/", "/dev/.systemd/"]: for canary in ["/run/systemd/system/", "/dev/.run/systemd/", "/dev/.systemd/"]:
if os.path.exists(canary): if os.path.exists(canary):