From b4789f13a733bfa50c394d8209127735333a52cf Mon Sep 17 00:00:00 2001 From: Jeffrey Chu Date: Mon, 18 Mar 2013 01:13:41 -0700 Subject: [PATCH] attempt to add service to chkconfig when suggested --- service | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service b/service index fb1da54df79..80df5210978 100644 --- a/service +++ b/service @@ -464,6 +464,9 @@ class LinuxService(Service): if self.enable_cmd.endswith("chkconfig"): (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: self.module.exit_json(msg="unknown service name") state = out.split()[-1]