Commit f1829a0f by Jeffrey Chu

attempt to add service to chkconfig when suggested

parent 2e797a51
...@@ -464,6 +464,9 @@ class LinuxService(Service): ...@@ -464,6 +464,9 @@ class LinuxService(Service):
if self.enable_cmd.endswith("chkconfig"): if self.enable_cmd.endswith("chkconfig"):
(rc, out, err) = self.execute_command("%s --list %s" % (self.enable_cmd, self.name)) (rc, out, err) = self.execute_command("%s --list %s" % (self.enable_cmd, self.name))
if 'chkconfig --add %s' % self.name in err:
self.execute_command("%s --add %s" % (self.enable_cmd, self.name))
(rc, out, err) = self.execute_command("%s --list %s" % (self.enable_cmd, self.name))
if not self.name in out: if not self.name in out:
self.module.exit_json(msg="unknown service name") self.module.exit_json(msg="unknown service name")
state = out.split()[-1] state = out.split()[-1]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment