From c8d6d5101166e778818fc7f3f4126d52b0b12017 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Wed, 8 Jun 2011 16:57:05 -0400 Subject: [PATCH] fix ubuntu reboot issue, sometimes when you install agent, the init script is not installed into /etc/rc* --- python/lib/cloudutils/serviceConfig.py | 6 +++--- python/lib/cloudutils/utilities.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/lib/cloudutils/serviceConfig.py b/python/lib/cloudutils/serviceConfig.py index 1c00e6cf676..17983137ae3 100644 --- a/python/lib/cloudutils/serviceConfig.py +++ b/python/lib/cloudutils/serviceConfig.py @@ -545,7 +545,7 @@ class cloudAgentConfig(serviceCfgBase): cfo.save() self.syscfg.svo.stopService("cloud-agent") - self.syscfg.svo.startService("cloud-agent") + self.syscfg.svo.enableService("cloud-agent") return True except: raise @@ -568,7 +568,7 @@ class cloudAgentConfig(serviceCfgBase): cfo.save() self.syscfg.svo.stopService("cloud-agent") - self.syscfg.svo.startService("cloud-agent") + self.syscfg.svo.enableService("cloud-agent") return True except: raise @@ -589,7 +589,7 @@ class cloudAgentConfig(serviceCfgBase): cfo.save() self.syscfg.svo.stopService("cloud-agent") - self.syscfg.svo.startService("cloud-agent") + self.syscfg.svo.enableService("cloud-agent") return True except: raise diff --git a/python/lib/cloudutils/utilities.py b/python/lib/cloudutils/utilities.py index a9663a1207c..4510128c6fa 100644 --- a/python/lib/cloudutils/utilities.py +++ b/python/lib/cloudutils/utilities.py @@ -168,8 +168,8 @@ class serviceOpsUbuntu(serviceOps): def enableService(self, servicename,forcestart=False): bash("update-rc.d -f " + servicename + " remove") - bash("update-rc.d -f " + servicename + " start 2 3 4 5 .") + bash("update-rc.d -f " + servicename + " defaults") return self.startService(servicename,force=forcestart) def isKVMEnabled(self): - return bash("kvm-ok").isSuccess() \ No newline at end of file + return bash("kvm-ok").isSuccess()