[Lxc-users] [PATCH] Define $hostname before its first use

Serge E. Hallyn serge.hallyn at canonical.com
Wed Sep 14 20:27:22 UTC 2011


Otherwise you get 'lxc.utsname =' in config, instead of the
actual hostname being filled in.

https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/850205

Index: lxc/src/lxc/lxc-clone.in
===================================================================
--- lxc.orig/src/lxc/lxc-clone.in	2011-09-14 15:04:30.459058616 -0500
+++ lxc/src/lxc/lxc-clone.in	2011-09-14 15:05:17.179057825 -0500
@@ -137,6 +137,8 @@
     exit 1
 fi
 
+hostname=$lxc_new
+
 trap "${bindir}/lxc-destroy -n $lxc_new; echo aborted; exit 1" SIGHUP SIGINT SIGTERM
 
 mkdir -p $lxc_path/$lxc_new
@@ -184,7 +186,6 @@
 fi
 
 echo "Updating rootfs..."
-hostname=$lxc_new
 
 # so you can 'ssh $hostname.' or 'ssh $hostname.local'
 if [ -f $rootfs/etc/dhcp/dhclient.conf ]; then




More information about the lxc-users mailing list