Author of the patch : Jonathan Liu <???> posted as a bug fix on the lxc 
sourceforge website.

OS: Arch Linux 32-bit

/etc/init.d/rcS do not use full path to syslogd, mount and udhcpc executables.
As busybox requires /proc mounted if CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" 
to run these commands without full path, the full path should be used in the 
startup script as /proc is mounted later in the script.

It also fails to start the machine if /lib64 does not exist on the host system 
as there is a mount entry for /lib64 in the config.

The attached patch changes commands in /etc/init.d/rcS to use full path and 
adds a check for /lib64 on host before adding lib64 mount entries to config.

Signed-off-by: Daniel Lezcano <dlezc...@fr.ibm.com>
---
 templates/lxc-busybox.in |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
index 62088df..720ceef 100644
--- a/templates/lxc-busybox.in
+++ b/templates/lxc-busybox.in
@@ -78,9 +78,9 @@ EOF
     # mount everything
     cat <<EOF >> $rootfs/etc/init.d/rcS
 #!/bin/sh
-syslogd
-mount -a
-udhcpc
+/bin/syslogd
+/bin/mount -a
+/bin/udhcpc
 EOF
 
     # executable
@@ -242,7 +242,7 @@ lxc.mount.entry=/usr/lib $rootfs/usr/lib none ro,bind 0 0
 EOF
 fi
 
-if [ -d "$rootfs/lib64" ]; then
+if [ -d "/lib64" ] && [ -d "$rootfs/lib64" ]; then
 cat <<EOF >> $path/config
 lxc.mount.entry=/lib64 $rootfs/lib64 none ro,bind 0 0
 lxc.mount.entry=/usr/lib64 $rootfs/usr/lib64 none ro,bind 0 0
-- 
1.7.1


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to