summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-06-16 13:50:30 +0000
committerSol Jerome <sol.jerome@gmail.com>2010-06-16 08:52:05 -0500
commit841b9201412aaf00d0c74a60ec21544e5c2c6c10 (patch)
tree00d087f4a21101daaec0d142bdcd6862afc569f7 /src/lib/Client
parent3b0da304269e30299784f5bd5e979a0673cb38fa (diff)
downloadbcfg2-841b9201412aaf00d0c74a60ec21544e5c2c6c10.tar.gz
bcfg2-841b9201412aaf00d0c74a60ec21544e5c2c6c10.tar.bz2
bcfg2-841b9201412aaf00d0c74a60ec21544e5c2c6c10.zip
Upstart: Fix bug when installing services
Signed-off-by: Sol Jerome <sol.jerome@gmail.com> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5938 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Tools/Upstart.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/Client/Tools/Upstart.py b/src/lib/Client/Tools/Upstart.py
index 12d82488d..113f28d23 100644
--- a/src/lib/Client/Tools/Upstart.py
+++ b/src/lib/Client/Tools/Upstart.py
@@ -59,12 +59,12 @@ class Upstart(Bcfg2.Client.Tools.SvcTool):
def InstallService(self, entry):
"""Install Service for entry."""
- if entry.get('mode', 'default') == 'supervised':
- pstatus, pout = self.cmd.run('/usr/sbin/service %s status' % \
- entry.get('name'))
- if pstatus:
- self.cmd.run('/usr/sbin/service %s start' % (entry.get('name')))
- return True
+ if entry.get('status') == 'on':
+ pstatus = self.cmd.run(self.get_svc_command(entry, 'start'))[0]
+ elif entry.get('status') == 'off':
+ pstatus = self.cmd.run(self.get_svc_command(entry, 'stop'))[0]
+ # pstatus is true if command failed
+ return not pstatus
def FindExtra(self):
"""Locate extra Upstart services."""