diff --git a/agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in b/agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in index 6ec54514be2..fcaaca8c33e 100755 --- a/agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in +++ b/agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in @@ -37,15 +37,6 @@ start() { log_end_msg 1 exit 1 fi - - # Workaround for ubuntu bug:577264, make sure cgconfig/cgred start before libvirt - service libvirt-bin stop - service cgred stop - service cgconfig stop - service cgconfig start - service cgred start - service libvirt-bin start - if start-stop-daemon --start --quiet \ --pidfile "$PIDFILE" \ diff --git a/debian/control b/debian/control index f0bdc54faee..0aea39138a1 100644 --- a/debian/control +++ b/debian/control @@ -141,7 +141,7 @@ Provides: vmops-agent Conflicts: vmops-agent Replaces: vmops-agent Architecture: any -Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-agent-scripts (= ${source:Version}), libcommons-httpclient-java, libcommons-collections-java, libcommons-dbcp-java, libcommons-pool-java, libcommons-logging-java, libvirt0, cloud-daemonize, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, cgroup-bin, augeas-tools, uuid-runtime, rsync, grep, iproute, jnetpcap, ebtables, vlan +Depends: openjdk-6-jre, cloud-utils (= ${source:Version}), cloud-core (= ${source:Version}), cloud-deps (= ${source:Version}), python, cloud-python (= ${source:Version}), cloud-agent-libs (= ${source:Version}), cloud-agent-scripts (= ${source:Version}), libcommons-httpclient-java, libcommons-collections-java, libcommons-dbcp-java, libcommons-pool-java, libcommons-logging-java, libvirt0, cloud-daemonize, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, jnetpcap, ebtables, vlan Description: Cloud.com agent The Cloud.com agent is in charge of managing shared computing resources in a Cloud.com Cloud Stack-powered cloud. Install this package if this computer diff --git a/python/lib/cloudutils/configFileOps.py b/python/lib/cloudutils/configFileOps.py index 46c432b8e43..e001e200c56 100644 --- a/python/lib/cloudutils/configFileOps.py +++ b/python/lib/cloudutils/configFileOps.py @@ -131,6 +131,27 @@ class configFileOps: file(self.fileName, "w").write(repl) if addToBackup: self.backups.append([src, dst]) + + def append_lines(self, match_lines, append_lines): + fp = file(self.fileName).read(-1) + sh = re.escape(match_lines) + match = re.search(sh, fp, re.MULTILINE) + if match is None: + return + + sh = re.escape(append_lines) + if re.search(sh, fp, re.MULTILINE) is not None: + return + + newlines = [] + for line in file(self.fileName).readlines(): + if re.search(match_lines, line) is not None: + newlines.append(line + append_lines) + self.backups.append([line, line + append_lines]) + else: + newlines.append(line) + + file(self.fileName, "w").writelines(newlines) def backup(self): for oldLine, newLine in self.backups: diff --git a/python/lib/cloudutils/serviceConfig.py b/python/lib/cloudutils/serviceConfig.py index c9171087602..a94ed6722bc 100644 --- a/python/lib/cloudutils/serviceConfig.py +++ b/python/lib/cloudutils/serviceConfig.py @@ -431,15 +431,9 @@ class libvirtConfigUbuntu(serviceCfgBase): def config(self): try: - cfgline = "export CGROUP_DAEMON='cpu:/virt'" - libvirtfile = "/etc/default/libvirt-bin" - cfo = configFileOps(libvirtfile, self) - cfo.add_lines(cfgline) - self.setupLiveMigration() - cfgline = "cgroup_controllers = [ \"cpu\" ]\n" \ - "security_driver = \"none\"\n" + cfgline = "security_driver = \"none\"\n" filename = "/etc/libvirt/qemu.conf" cfo = configFileOps(filename, self) diff --git a/python/lib/cloudutils/syscfg.py b/python/lib/cloudutils/syscfg.py index 1604a9be7b9..74607f0f106 100644 --- a/python/lib/cloudutils/syscfg.py +++ b/python/lib/cloudutils/syscfg.py @@ -91,8 +91,7 @@ class sysConfigAgentUbuntu(sysConfigAgent): super(sysConfigAgentUbuntu, self).__init__(glbEnv) self.svo = serviceOpsUbuntu() - self.services = [cgroupConfig(self), - securityPolicyConfigUbuntu(self), + self.services = [securityPolicyConfigUbuntu(self), networkConfigUbuntu(self), libvirtConfigUbuntu(self), firewallConfigUbuntu(self),