fixes for insserv on SLES11

fixes #23700, seems SLES11 has diff behaviour of insserv
these changes are compatible with debian/ubuntu.
This commit is contained in:
Brian Coca 2017-04-21 12:50:18 -04:00 committed by Brian Coca
parent fab2dfd1c6
commit a86878c425

View file

@ -853,13 +853,13 @@ class LinuxService(Service):
return
#
# insserv (Debian 7)
# insserv (Debian <=7, SLES, others)
#
if self.enable_cmd.endswith("insserv"):
if self.enable:
(rc, out, err) = self.execute_command("%s -n %s" % (self.enable_cmd, self.name))
(rc, out, err) = self.execute_command("%s -n -v %s" % (self.enable_cmd, self.name))
else:
(rc, out, err) = self.execute_command("%s -nr %s" % (self.enable_cmd, self.name))
(rc, out, err) = self.execute_command("%s -n -r -v %s" % (self.enable_cmd, self.name))
self.changed = False
for line in err.splitlines():