1
Description: in precise, make /dev/shm a symbolic link to /run/shm
2
This would be done (though done wrongly) by mounted-dev.conf, but
3
that doesn't run because we don't mount /dev.
4
Author: Serge Hallyn <serge.hallyn@ubuntu.com>
6
Bug-Ubuntu: https://bugs.launchpad.net/launchpad/+bug/974584
8
Index: lxc-0.7.5/templates/lxc-ubuntu-cloud.in
9
===================================================================
10
--- lxc-0.7.5.orig/templates/lxc-ubuntu-cloud.in 2012-04-12 10:33:38.000000000 -0500
11
+++ lxc-0.7.5/templates/lxc-ubuntu-cloud.in 2012-04-12 11:11:57.066675104 -0500
18
if [ $arch = "i386" ]; then
21
sysfs sys sysfs defaults 0 0
24
+ # rmdir /dev/shm in precise containers.
25
+ # I'm afraid of doing rm -rf $rootfs/dev/shm, in case it did
26
+ # get bind mounted to the host's /run/shm. So try to rmdir
27
+ # it, and in case that fails move it out of the way.
28
+ if [ $release = "precise" ]; then
29
+ [ -d "$rootfs/dev/shm" ] && rmdir $rootfs/dev/shm
30
+ [ -e "$rootfs/dev/shm" ] && mv $rootfs/dev/shm $rootfs/dev/shm.bak
31
+ ln -s /run/shm $rootfs/dev/shm
39
) 200>/var/lock/subsys/lxc-ubucloud
41
-copy_configuration $path $rootfs $name $arch
42
+copy_configuration $path $rootfs $name $arch $release
44
echo "Container $name created."
46
Index: lxc-0.7.5/templates/lxc-ubuntu.in
47
===================================================================
48
--- lxc-0.7.5.orig/templates/lxc-ubuntu.in 2012-04-12 10:33:38.000000000 -0500
49
+++ lxc-0.7.5/templates/lxc-ubuntu.in 2012-04-12 11:11:36.498674838 -0500
51
chroot $rootfs apt-get update
52
chroot $rootfs apt-get install --force-yes -y --no-install-recommends upstart:${hostarch} mountall:amd64 iproute:amd64 isc-dhcp-client:amd64
55
+ # rmdir /dev/shm in precise containers.
56
+ # I'm afraid of doing rm -rf $rootfs/dev/shm, in case it did
57
+ # get bind mounted to the host's /run/shm. So try to rmdir
58
+ # it, and in case that fails move it out of the way.
59
+ if [ $release = "precise" ]; then
60
+ [ -d "$rootfs/dev/shm" ] && rmdir $rootfs/dev/shm
61
+ [ -e "$rootfs/dev/shm" ] && mv $rootfs/dev/shm $rootfs/dev/shm.bak
62
+ ln -s /run/shm $rootfs/dev/shm