Proposed fix for issue #7757

This commit is contained in:
Eri Bastos 2014-06-13 15:06:10 -03:00 committed by James Cammarata
parent 5f1f4ef3fd
commit 6f8a29dc3d

View file

@ -576,7 +576,7 @@ class LinuxService(Service):
override_file.close()
initpath = '/etc/init'
manreg = re.compile('^manual\s*$', re.M | re.I)
manreg = re.compile('^start on manual\s*$', re.M | re.I)
conf_file_name = "%s/%s.conf" % (initpath, self.name)
override_file_name = "%s/%s.override" % (initpath, self.name)
@ -591,12 +591,12 @@ class LinuxService(Service):
write_to_override_file(override_file_name, manreg.sub('', override_file_contents))
# Add manual stanza if not present and service disabled
elif not (self.enable) and not (manreg.search(override_file_contents)):
write_to_override_file(override_file_name, override_file_contents + '\nmanual\n')
write_to_override_file(override_file_name, override_file_contents + '\nstart on manual\n')
else:
return
# Add file with manual stanza if service disabled
elif not (self.enable):
write_to_override_file(override_file_name, 'manual\n')
write_to_override_file(override_file_name, 'start on manual\n')
else:
return