2011/9/27 Greg Kurz :
> On Tue, 2011-09-27 at 14:10 +0200, Frederic Crozat wrote:
>> Le vendredi 26 août 2011 à 16:00 +0400, Alexey Shabalin a écrit :
>> > 2011/8/26 Daniel Lezcano :
>> > > On 08/23/2011 03:56 PM, Alexey Shabalin wrote:
>> > >> Hello.
>> > >> I think the directory /etc better suited for storing configuration 
>> > >> files.
>> > >> This patch allows you to specify the location configs as options for
>> > >> ./configure.
>> > >
>> > > Is this patch to store the configuraton files in /etc/lxc and the rootfs
>> > > in /var/lib/lxc ?
>> >
>> > yes.
>> > this patch add new option --with-container-path (default /var/lib/lxc)
>> > and change option --with-config-path (default /etc/lxc).
>> > If you want to use configs in /var/lib/lxc, you can use
>> > --with-config-path=/var/lib/lxc.
>>
>> Any status on this patch ?
>>
>
> I don't have any opinion on this patch, but it's likely to conflict
> with:
>
> http://lxc.git.sourceforge.net/git/gitweb.cgi?p=lxc/lxc;a=commit;h=1c41ddcb4af633ac906f1d7c9ef1dc7d121d7850
>
> I guess it should be rebased and resent.
>
> Cheers.

Update patch.


-- 
Alexey Shabalin
From f539bfc70955c03e87804de649a01cc94fb3bab8 Mon Sep 17 00:00:00 2001
From: Alexey Shabalin <sh...@altlinux.org>
Date: Tue, 23 Aug 2011 16:35:23 +0300
Subject: [PATCH] - Change --with-config-path in configure for define path for
 config files. - Add --with-container-path to configure for
 define path for containers repository. Allow install config
 files for containers to /etc/lxc dir. For old way you can
 use same --with-config-path and --with-container-path.

Conflicts:

	configure.ac
	src/lxc/lxc-clone.in
	templates/lxc-debian.in
	templates/lxc-fedora.in

Signed-off-by: Alexey Shabalin <sh...@altlinux.org>
---
 configure.ac              |   13 ++++++++++---
 src/lxc/lxc-clone.in      |   32 +++++++++++++++++---------------
 src/lxc/lxc-create.in     |    8 +++++---
 src/lxc/lxc-destroy.in    |    6 ++++--
 src/lxc/lxc_execute.c     |    2 +-
 src/lxc/lxc_restart.c     |    2 +-
 src/lxc/lxc_start.c       |    2 +-
 templates/lxc-busybox.in  |   11 ++++++-----
 templates/lxc-debian.in   |   11 ++++++-----
 templates/lxc-fedora.in   |    5 +++--
 templates/lxc-lenny.in    |    7 ++++---
 templates/lxc-opensuse.in |   11 ++++++-----
 templates/lxc-sshd.in     |    9 +++++----
 templates/lxc-ubuntu.in   |   11 ++++++-----
 14 files changed, 75 insertions(+), 55 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6fa8c4a..c6e35b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,8 +49,14 @@ AS_AC_EXPAND(DOCDIR, $docdir)
 AC_ARG_WITH([config-path],
 	[AC_HELP_STRING(
 		[--with-config-path=dir],
-		[lxc configuration repository path]
-	)], [], [with_config_path=['${localstatedir}/lib/lxc']])
+		[lxc configuration files path]
+	)], [], [with_config_path="${sysconfdir}/lxc"])
+
+AC_ARG_WITH([container-path],
+	[AC_HELP_STRING(
+		[--with-container-path=dir],
+		[lxc containers repository path]
+	)], [], [with_container_path="${localstatedir}/lib/lxc"])
 
 AC_ARG_WITH([rootfs-path],
 	[AC_HELP_STRING(
@@ -60,7 +66,8 @@ AC_ARG_WITH([rootfs-path],
 
 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
 
-AC_SUBST(LXCPATH, "${with_config_path}")
+AC_SUBST(LXCETCPATH, "${with_config_path}")
+AC_SUBST(LXCPATH, "${with_container_path}")
 AC_SUBST(LXCROOTFSMOUNT, "${with_rootfs_path}")
 AC_SUBST(LXCINITDIR, ['${libdir}/lxc'])
 AC_SUBST(LXCTEMPLATEDIR, ['${libdir}/lxc/templates'])
diff --git a/src/lxc/lxc-clone.in b/src/lxc/lxc-clone.in
index 657486d..e3ce836 100644
--- a/src/lxc/lxc-clone.in
+++ b/src/lxc/lxc-clone.in
@@ -42,7 +42,8 @@ help() {
 
 shortoptions='ho:n:sL:v:p:t:'
 longoptions='help,orig:,name:,snapshot,fssize:,vgname:,lvprefix:,fstype:'
-lxc_path=/var/lib/lxc
+lxc_path=@LXCPATH@
+config_path=@LXCETCPATH@
 bindir=/usr/bin
 snapshot=no
 lxc_size=2G
@@ -137,12 +138,12 @@ if [ ! -r $lxc_path ]; then
     exit 1
 fi
 
-if [ ! -d "$lxc_path/$lxc_orig" ]; then
+if [ ! -d "$lxc_path/$lxc_orig" -o ! -f "$config_path/$lxc_orig/config" ]; then
     echo "'$lxc_orig' does not exist"
     exit 1
 fi
 
-if [ -d "$lxc_path/$lxc_new" ]; then
+if [ -d "$lxc_path/$lxc_new" -o -f "$config_path/$lxc_new/config" ]; then
     echo "'$lxc_new' already exists"
     exit 1
 fi
@@ -150,19 +151,20 @@ fi
 trap "${bindir}/lxc-destroy -n $lxc_new; echo aborted; exit 1" SIGHUP SIGINT SIGTERM
 
 mkdir -p $lxc_path/$lxc_new
+mkdir -p $config_path/$lxc_new
 
 hostname=$lxc_new
 
 echo "Tweaking configuration"
-cp $lxc_path/$lxc_orig/config $lxc_path/$lxc_new/config
-sed -i '/lxc.utsname/d' $lxc_path/$lxc_new/config
-echo "lxc.utsname = $hostname" >> $lxc_path/$lxc_new/config
+cp $config_path/$lxc_orig/config $config_path/$lxc_new/config
+sed -i '/lxc.utsname/d' $config_path/$lxc_new/config
+echo "lxc.utsname = $hostname" >> $config_path/$lxc_new/config
 
-grep "lxc.mount =" $lxc_path/$lxc_new/config >/dev/null 2>&1 && { sed -i '/lxc.mount =/d' $lxc_path/$lxc_new/config; echo "lxc.mount = $lxc_path/$lxc_new/fstab" >> $lxc_path/$lxc_new/config; }
+grep "lxc.mount =" $config_path/$lxc_new/config >/dev/null 2>&1 && { sed -i '/lxc.mount =/d' $config_path/$lxc_new/config; echo "lxc.mount = $config_path/$lxc_new/fstab" >> $config_path/$lxc_new/config; }
 
-if [ -e  $lxc_path/$lxc_orig/fstab ];then
-    cp $lxc_path/$lxc_orig/fstab $lxc_path/$lxc_new/fstab
-    sed -i "s@$lxc_path/$lxc_orig@$lxc_path/$lxc_new@" $lxc_path/$lxc_new/fstab
+if [ -e  $config_path/$lxc_orig/fstab ];then
+    cp $config_path/$lxc_orig/fstab $config_path/$lxc_new/fstab
+    sed -i "s@$config_path/$lxc_orig@$config_path/$lxc_new@" $config_path/$lxc_new/fstab
 fi
 
 echo "Copying rootfs..."
@@ -177,8 +179,8 @@ if [ $? -ne 0 ]; then
 else
     container_running=False
 fi
-sed -i '/lxc.rootfs/d' $lxc_path/$lxc_new/config
-oldroot=`grep lxc.rootfs $lxc_path/$lxc_orig/config | awk -F= '{ print $2 '}`
+sed -i '/lxc.rootfs/d' $config_path/$lxc_new/config
+oldroot=`grep lxc.rootfs $config_path/$lxc_orig/config | awk -F= '{ print $2 '}`
 if [ -b $oldroot ]; then
 	# this is a device.  If we don't want to snapshot, then mkfs, mount
 	# and rsync.  Trivial but not yet implemented
@@ -213,7 +215,7 @@ if [ -b $oldroot ]; then
             mount /dev/$lxc_vg/${lxc_lv_prefix}${lxc_new}_snapshot ${rootfs}_snapshot || { echo "failed to mount new rootfs_snapshot"; exit 1; }
             #create a new lv
             lvcreate -L $lxc_size $lxc_vg -n ${lxc_lv_prefix}$lxc_new
-	    echo "lxc.rootfs = /dev/$lxc_vg/${lxc_lv_prefix}$lxc_new" >> $lxc_path/$lxc_new/config
+	    echo "lxc.rootfs = /dev/$lxc_vg/${lxc_lv_prefix}$lxc_new" >> $config_path/$lxc_new/config
 	    # and mount it so we can tweak it
             mkdir -p $lxc_path/$lxc_new/rootfs
             mkfs -t $fstype /dev/$lxc_vg/${lxc_lv_prefix}$lxc_new
@@ -225,7 +227,7 @@ if [ -b $oldroot ]; then
             lvremove -f $lxc_vg/${lxc_lv_prefix}$lxc_new || echo "failed to remove the snapshot"
         else
             lvrename $lxc_vg/${lxc_lv_prefix}}${lxc_new}_snapshot $lxc_vg/${lxc_lv_prefix}$lxc_new
-            echo "lxc.rootfs = /dev/$lxc_vg/${lxc_lv_prefix}$lxc_new" >> $lxc_path/$lxc_new/config
+            echo "lxc.rootfs = /dev/$lxc_vg/${lxc_lv_prefix}$lxc_new" >> $config_path/$lxc_new/config
 	    # and mount it so we can tweak it
             mkdir -p $lxc_path/$lxc_new/rootfs
             mount /dev/$lxc_vg/${lxc_lv_prefix}$lxc_new $rootfs || { echo "failed to mount new rootfs"; exit 1; }
@@ -245,7 +247,7 @@ else
             echo "copying rootfs failed"
             exit 1
         fi
-	echo "lxc.rootfs = $rootfs" >> $lxc_path/$lxc_new/config
+	echo "lxc.rootfs = $rootfs" >> $config_path/$lxc_new/config
 fi
 
 echo "Updating rootfs..."
diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in
index d14c32e..d8af8f6 100644
--- a/src/lxc/lxc-create.in
+++ b/src/lxc/lxc-create.in
@@ -49,6 +49,7 @@ help() {
 shortoptions='hn:f:t:'
 longoptions='help,name:,config:,template:'
 lxc_path=@LXCPATH@
+lxc_etc_path=@LXCETCPATH@
 bindir=@BINDIR@
 libdir=@LIBDIR@
 templatedir=@LXCTEMPLATEDIR@
@@ -119,7 +120,7 @@ if [ ! -r $lxc_path ]; then
     exit 1
 fi
 
-if [ -d "$lxc_path/$lxc_name" ]; then
+if [ -d "$lxc_path/$lxc_name" -o -d "$lxc_etc_path/$lxc_name" ]; then
     echo "'$lxc_name' already exists"
     exit 1
 fi
@@ -127,16 +128,17 @@ fi
 trap "${bindir}/lxc-destroy -n $lxc_name; echo aborted; exit 1" SIGHUP SIGINT SIGTERM
 
 mkdir -p $lxc_path/$lxc_name
+mkdir -p $lxc_etc_path/$lxc_name
 
 if [ -z "$lxc_config" ]; then
-    touch $lxc_path/$lxc_name/config
+    touch $lxc_etc_path/$lxc_name/config
 else
     if [ ! -r "$lxc_config" ]; then
 	echo "'$lxc_config' configuration file not found"
 	exit 1
     fi
 
-    cp $lxc_config $lxc_path/$lxc_name/config
+    cp $lxc_config $lxc_etc_path/$lxc_name/config
 fi
 
 if [ ! -z $lxc_template ]; then
diff --git a/src/lxc/lxc-destroy.in b/src/lxc/lxc-destroy.in
index ddd3c3b..91bdbe1 100644
--- a/src/lxc/lxc-destroy.in
+++ b/src/lxc/lxc-destroy.in
@@ -37,6 +37,7 @@ fi
 shortoptions='n:'
 longoptions='name:'
 lxc_path=@LXCPATH@
+lxc_etc_path=@LXCETCPATH@
 
 getopt=$(getopt -o $shortoptions --longoptions  $longoptions -- "$@")
 if [ $? != 0 ]; then
@@ -70,7 +71,7 @@ if [ -z "$lxc_name" ]; then
     exit 1
 fi
 
-if [ ! -d "$lxc_path/$lxc_name" ]; then
+if [ ! -d "$lxc_path/$lxc_name" -o ! -f "$lxc_etc_path/$lxc_name/config"  ]; then
     echo "'$lxc_name' does not exist"
     exit 1
 fi
@@ -78,7 +79,7 @@ fi
 # Deduce the type of rootfs
 # If LVM partition, destroy it.  If anything else, ignore it.  We'll support
 # deletion of others later.
-rootdev=`grep lxc.rootfs $lxc_path/$lxc_name/config | awk -F= '{ print $2 '}`
+rootdev=`grep lxc.rootfs $lxc_etc_path/$lxc_name/config | awk -F= '{ print $2 '}`
 if [ -b $rootdev -o -h $rootdev ]; then
 	lvdisplay $rootdev > /dev/null 2>&1
 	if [ $? -eq 0 ]; then
@@ -87,3 +88,4 @@ if [ -b $rootdev -o -h $rootdev ]; then
 fi
 # recursively remove the container to remove old container configuration
 rm -rf --preserve-root $lxc_path/$lxc_name
+rm -rf --preserve-root $lxc_etc_path/$lxc_name
diff --git a/src/lxc/lxc_execute.c b/src/lxc/lxc_execute.c
index f480859..e2dd5b1 100644
--- a/src/lxc/lxc_execute.c
+++ b/src/lxc/lxc_execute.c
@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
 	else {
 		int rc;
 
-		rc = asprintf(&rcfile, LXCPATH "/%s/config", my_args.name);
+		rc = asprintf(&rcfile, LXCETCPATH "/%s/config", my_args.name);
 		if (rc == -1) {
 			SYSERROR("failed to allocate memory");
 			return -1;
diff --git a/src/lxc/lxc_restart.c b/src/lxc/lxc_restart.c
index 7548682..31c8143 100644
--- a/src/lxc/lxc_restart.c
+++ b/src/lxc/lxc_restart.c
@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
 	else {
 		int rc;
 
-		rc = asprintf(&rcfile, LXCPATH "/%s/config", my_args.name);
+		rc = asprintf(&rcfile, LXCETCPATH "/%s/config", my_args.name);
 		if (rc == -1) {
 			SYSERROR("failed to allocate memory");
 			return -1;
diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c
index fdd4c72..36b4dd8 100644
--- a/src/lxc/lxc_start.c
+++ b/src/lxc/lxc_start.c
@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
 	else {
 		int rc;
 
-		rc = asprintf(&rcfile, LXCPATH "/%s/config", my_args.name);
+		rc = asprintf(&rcfile, LXCETCPATH "/%s/config", my_args.name);
 		if (rc == -1) {
 			SYSERROR("failed to allocate memory");
 			return err;
diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
index 720ceef..ccd5830 100644
--- a/templates/lxc-busybox.in
+++ b/templates/lxc-busybox.in
@@ -224,11 +224,11 @@ configure_busybox()
 
 copy_configuration()
 {
-    path=$1
+    config_path=$1
     rootfs=$2
     name=$3
 
-cat <<EOF >> $path/config
+cat <<EOF >> $config_path/$name/config
 lxc.utsname = $name
 lxc.tty = 1
 lxc.pts = 1
@@ -236,14 +236,14 @@ lxc.rootfs = $rootfs
 EOF
 
 if [ -d "$rootfs/lib" ]; then
-cat <<EOF >> $path/config
+cat <<EOF >> $config_path/$name/config
 lxc.mount.entry=/lib $rootfs/lib none ro,bind 0 0
 lxc.mount.entry=/usr/lib $rootfs/usr/lib none ro,bind 0 0
 EOF
 fi
 
 if [ -d "/lib64" ] && [ -d "$rootfs/lib64" ]; then
-cat <<EOF >> $path/config
+cat <<EOF >> $config_path/$name/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
 EOF
@@ -287,6 +287,7 @@ if [ -z "$path" ]; then
 fi
 
 rootfs=$path/rootfs
+config_path=@LXCETCPATH@
 
 install_busybox $rootfs $name
 if [ $? -ne 0 ]; then
@@ -300,7 +301,7 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-copy_configuration $path $rootfs $name
+copy_configuration $config_path $rootfs $name
 if [ $? -ne 0 ]; then
     echo "failed to write configuration file"
     exit 1
diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in
index 9d33113..43c0b00 100644
--- a/templates/lxc-debian.in
+++ b/templates/lxc-debian.in
@@ -184,15 +184,15 @@ install_debian()
 
 copy_configuration()
 {
-    path=$1
+    config_path=$1
     rootfs=$2
-    hostname=$3
+    name=$3
 
-    cat <<EOF >> $path/config
+    cat <<EOF >> $config_path/$name/config
 lxc.tty = 4
 lxc.pts = 1024
 lxc.rootfs = $rootfs
-lxc.utsname = $hostname
+lxc.utsname = $name
 lxc.cgroup.devices.deny = a
 # /dev/null and zero
 lxc.cgroup.devices.allow = c 1:3 rwm
@@ -295,6 +295,7 @@ if [ "$(id -u)" != "0" ]; then
 fi
 
 rootfs=$path/rootfs
+config_path=@LXCETCPATH@
 
 install_debian $rootfs
 if [ $? -ne 0 ]; then
@@ -308,7 +309,7 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-copy_configuration $path $rootfs $name
+copy_configuration $config_path $rootfs $name
 if [ $? -ne 0 ]; then
     echo "failed write configuration file"
     exit 1
diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in
index d35600a..b347960 100644
--- a/templates/lxc-fedora.in
+++ b/templates/lxc-fedora.in
@@ -28,7 +28,8 @@
 #Configurations
 arch=$(arch)
 cache_base=/var/cache/lxc/fedora/$arch
-default_path=/var/lib/lxc
+default_path=@LXCPATH@
+default_config_path=@LXCETCPATH@
 root_password=rooter
 lxc_network_type=veth
 lxc_network_link=virbr0
@@ -327,7 +328,7 @@ fi
 
 
 rootfs_path=$path/$name/rootfs
-config_path=$default_path/$name
+config_path=$default_config_path/$name
 cache=$cache_base/$release
 
 revert()
diff --git a/templates/lxc-lenny.in b/templates/lxc-lenny.in
index 3720dce..b9bc4a2 100644
--- a/templates/lxc-lenny.in
+++ b/templates/lxc-lenny.in
@@ -174,11 +174,11 @@ install_debian()
 
 copy_configuration()
 {
-    path=$1
+    config_path=$1
     rootfs=$2
     name=$3
 
-    cat <<EOF >> $path/config
+    cat <<EOF >> $config_path/$name/config
 lxc.tty = 4
 lxc.pts = 1024
 lxc.rootfs = $rootfs
@@ -284,6 +284,7 @@ if [ "$(id -u)" != "0" ]; then
 fi
 
 rootfs=$path/rootfs
+config_path=@LXCETCPATH@
 
 install_debian $rootfs
 if [ $? -ne 0 ]; then
@@ -297,7 +298,7 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-copy_configuration $path $rootfs
+copy_configuration $config_path $rootfs $name
 if [ $? -ne 0 ]; then
     echo "failed write configuration file"
     exit 1
diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in
index 811876a..8e90b18 100644
--- a/templates/lxc-opensuse.in
+++ b/templates/lxc-opensuse.in
@@ -228,17 +228,17 @@ install_opensuse()
 
 copy_configuration()
 {
-    path=$1
+    config_path=$1
     rootfs=$2
     name=$3
 
-    cat <<EOF >> $path/config
+    cat <<EOF >> $config_path/$name/config
 lxc.utsname = $name
 
 lxc.tty = 4
 lxc.pts = 1024
 lxc.rootfs = $rootfs
-lxc.mount  = $path/fstab
+lxc.mount  = $config_path/$name/fstab
 
 lxc.cgroup.devices.deny = a
 # /dev/null and zero
@@ -258,7 +258,7 @@ lxc.cgroup.devices.allow = c 5:2 rwm
 lxc.cgroup.devices.allow = c 254:0 rwm
 EOF
 
-    cat <<EOF > $path/fstab
+    cat <<EOF > $config_path/$name/fstab
 proc            $rootfs/proc         proc	nodev,noexec,nosuid 0 0
 sysfs           $rootfs/sys          sysfs	defaults  0 0
 EOF
@@ -343,6 +343,7 @@ if [ "$(id -u)" != "0" ]; then
 fi
 
 rootfs=$path/rootfs
+config_path=@LXCETCPATH@
 
 install_opensuse $rootfs
 if [ $? -ne 0 ]; then
@@ -356,7 +357,7 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-copy_configuration $path $rootfs $name
+copy_configuration $config_path $rootfs $name
 if [ $? -ne 0 ]; then
     echo "failed write configuration file"
     exit 1
diff --git a/templates/lxc-sshd.in b/templates/lxc-sshd.in
index 0e8346f..c57843b 100644
--- a/templates/lxc-sshd.in
+++ b/templates/lxc-sshd.in
@@ -92,11 +92,11 @@ EOF
 
 copy_configuration()
 {
-    path=$1
+    config_path=$1
     rootfs=$2
     name=$3
 
-cat <<EOF >> $path/config
+cat <<EOF >> $config_path/$name/config
 lxc.utsname = $name
 lxc.pts = 1024
 lxc.rootfs = $rootfs
@@ -110,7 +110,7 @@ lxc.mount.entry=@LXCTEMPLATEDIR@/lxc-sshd $rootfs/sbin/init none bind 0 0
 EOF
 
 if [ "$(uname -m)" = "x86_64" ]; then
-    cat <<EOF >> $path/config
+    cat <<EOF >> $config_path/$name/config
 lxc.mount.entry=/lib64 $rootfs/lib64 none ro,bind 0 0
 EOF
 fi
@@ -171,6 +171,7 @@ if [ -z "$path" ]; then
 fi
 
 rootfs=$path/rootfs
+config_path=@LXCETCPATH@
 
 install_sshd $rootfs
 if [ $? -ne 0 ]; then
@@ -184,7 +185,7 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-copy_configuration $path $rootfs $name
+copy_configuration $config_path $rootfs $name
 if [ $? -ne 0 ]; then
     echo "failed to write configuration file"
     exit 1
diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
index 9a41a49..f966bd8 100644
--- a/templates/lxc-ubuntu.in
+++ b/templates/lxc-ubuntu.in
@@ -162,7 +162,7 @@ install_ubuntu()
 
 copy_configuration()
 {
-    path=$1
+    config_path=$1
     rootfs=$2
     name=$3
     arch=$4
@@ -171,13 +171,13 @@ copy_configuration()
         arch="i686"
     fi
 
-    cat <<EOF >> $path/config
+    cat <<EOF >> $config_path/$name/config
 lxc.utsname = $name
 
 lxc.tty = 4
 lxc.pts = 1024
 lxc.rootfs = $rootfs
-lxc.mount  = $path/fstab
+lxc.mount  = $config_path/$name/fstab
 lxc.arch = $arch
 
 lxc.cgroup.devices.deny = a
@@ -200,7 +200,7 @@ lxc.cgroup.devices.allow = c 254:0 rwm
 lxc.cgroup.devices.allow = c 10:229 rwm
 EOF
 
-    cat <<EOF > $path/fstab
+    cat <<EOF > $config_path/$name/fstab
 proc            $rootfs/proc         proc    nodev,noexec,nosuid 0 0
 sysfs           $rootfs/sys          sysfs defaults  0 0
 EOF
@@ -468,6 +468,7 @@ if [ "$(id -u)" != "0" ]; then
 fi
 
 rootfs=$path/rootfs
+config_path=@LXCETCPATH@
 
 install_ubuntu $rootfs $release
 if [ $? -ne 0 ]; then
@@ -481,7 +482,7 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-copy_configuration $path $rootfs $name $arch
+copy_configuration $config_path $rootfs $name $arch
 if [ $? -ne 0 ]; then
     echo "failed write configuration file"
     exit 1
-- 
1.7.6.4

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to