Skip to content

Commit 9528b4d

Browse files
committed
remove cgroup on ubuntu, as sometimes it hang reboot
1 parent ba6af49 commit 9528b4d

5 files changed

Lines changed: 24 additions & 19 deletions

File tree

agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ start() {
3737
log_end_msg 1
3838
exit 1
3939
fi
40-
41-
# Workaround for ubuntu bug:577264, make sure cgconfig/cgred start before libvirt
42-
service libvirt-bin stop
43-
service cgred stop
44-
service cgconfig stop
45-
service cgconfig start
46-
service cgred start
47-
service libvirt-bin start
48-
4940

5041
if start-stop-daemon --start --quiet \
5142
--pidfile "$PIDFILE" \

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Provides: vmops-agent
141141
Conflicts: vmops-agent
142142
Replaces: vmops-agent
143143
Architecture: any
144-
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
144+
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
145145
Description: Cloud.com agent
146146
The Cloud.com agent is in charge of managing shared computing resources in
147147
a Cloud.com Cloud Stack-powered cloud. Install this package if this computer

python/lib/cloudutils/configFileOps.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,27 @@ def replace_lines(self, src, dst, addToBackup=True):
131131
file(self.fileName, "w").write(repl)
132132
if addToBackup:
133133
self.backups.append([src, dst])
134+
135+
def append_lines(self, match_lines, append_lines):
136+
fp = file(self.fileName).read(-1)
137+
sh = re.escape(match_lines)
138+
match = re.search(sh, fp, re.MULTILINE)
139+
if match is None:
140+
return
141+
142+
sh = re.escape(append_lines)
143+
if re.search(sh, fp, re.MULTILINE) is not None:
144+
return
145+
146+
newlines = []
147+
for line in file(self.fileName).readlines():
148+
if re.search(match_lines, line) is not None:
149+
newlines.append(line + append_lines)
150+
self.backups.append([line, line + append_lines])
151+
else:
152+
newlines.append(line)
153+
154+
file(self.fileName, "w").writelines(newlines)
134155

135156
def backup(self):
136157
for oldLine, newLine in self.backups:

python/lib/cloudutils/serviceConfig.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,15 +431,9 @@ def setupLiveMigration(self):
431431

432432
def config(self):
433433
try:
434-
cfgline = "export CGROUP_DAEMON='cpu:/virt'"
435-
libvirtfile = "/etc/default/libvirt-bin"
436-
cfo = configFileOps(libvirtfile, self)
437-
cfo.add_lines(cfgline)
438-
439434
self.setupLiveMigration()
440435

441-
cfgline = "cgroup_controllers = [ \"cpu\" ]\n" \
442-
"security_driver = \"none\"\n"
436+
cfgline = "security_driver = \"none\"\n"
443437
filename = "/etc/libvirt/qemu.conf"
444438

445439
cfo = configFileOps(filename, self)

python/lib/cloudutils/syscfg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ def __init__(self, glbEnv):
9191
super(sysConfigAgentUbuntu, self).__init__(glbEnv)
9292
self.svo = serviceOpsUbuntu()
9393

94-
self.services = [cgroupConfig(self),
95-
securityPolicyConfigUbuntu(self),
94+
self.services = [securityPolicyConfigUbuntu(self),
9695
networkConfigUbuntu(self),
9796
libvirtConfigUbuntu(self),
9897
firewallConfigUbuntu(self),

0 commit comments

Comments
 (0)