[lxc-devel] define a mount point for the rootfs

2010-05-12 Thread Daniel Lezcano
The previous code was creating a temporary directory /tmp/lxc- to
mount the rootfs, this is needed to separate the filesystem for the
pivot_root, when the rootfs and the host fs are the same.

According to the pivot_root man page:
"new_root and put_old must not be on the same file system as the current root."

Unfortunately, /tmp was populated with a temporary directory which was
never removed and furthermore, as Michael Tokarev pointed it, we can not
mount on read-only system fs on the host due to this directory creation.

A dirty fix was made to use /tmp to mount the rootfs, but of course that
will prevent to put the rootfs in /tmp.

This patchset address these problems by setting a default mount point,
$localstatedir/run/lxc, (it is up to the user to create this directory
when installing lxc by a manual mkdir, a rpm, a deb or whatever).
May be /var/run/lxc is not good place ... Just let me know.

If the user wants to override this mount point, then he can use
the configuration option 'lxc.rootfs.mount='.

TODO : check if we can get rid of this rbind mount if rootfs and hostfs
are not on the same fs.


--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [PATCH 1/5] whitespace cleanup in configure.ac

2010-05-12 Thread Daniel Lezcano
From: Daniel Lezcano 

Mindless changes by removing whitespace.

Signed-off-by: Daniel Lezcano 
---
 configure.ac |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4c8c50f..c6cac11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,9 +55,9 @@ AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
 AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR")
 
 AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
- [],
- AC_MSG_ERROR([netlink headers not found. Please install the 
linux kernel headers.]),
- [#include 
+ [],
+ AC_MSG_ERROR([netlink headers not found. 
Please install the linux kernel headers.]),
+ [#include 
 ])
 
 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install 
libcap-devel.]),
@@ -76,12 +76,12 @@ if test "x$GCC" = "xyes"; then
 fi
 
 AC_CONFIG_FILES([
-Makefile
+   Makefile
lxc.pc
lxc.spec
-config/Makefile
+   config/Makefile
 
-doc/Makefile
+   doc/Makefile
doc/lxc-create.sgml
doc/lxc-destroy.sgml
doc/lxc-execute.sgml
@@ -116,7 +116,7 @@ AC_CONFIG_FILES([
scripts/lxc-fedora
scripts/lxc-sshd
 
-src/Makefile
+   src/Makefile
src/lxc/Makefile
src/lxc/lxc-ps
src/lxc/lxc-ls
-- 
1.6.3.3


--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [PATCH 2/5] add a configure option to set a rootfs mount point

2010-05-12 Thread Daniel Lezcano
From: Daniel Lezcano 

Add a configure option to set a mount point path when using a rootfs,
that will replace the actual behavior which creates uneeded /tmp/lxc**
directories.

Signed-off-by: Daniel Lezcano 
---
 configure.ac |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index c6cac11..c8669b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,12 +47,21 @@ AC_ARG_WITH([config-path],
[lxc configuration repository path]
)], [], [with_config_path="${localstatedir}/lib/lxc"])
 
+AC_ARG_WITH([rootfs-path],
+   [AC_HELP_STRING(
+   [--with-rootfs-path=dir],
+   [lxc rootfs mount point]
+   )], [], [with_rootfs_path="${localstatedir}/run/lxc"])
+
 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
 AS_AC_EXPAND(LXCPATH, "${with_config_path}")
+AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
 AH_TEMPLATE([LXCPATH], [lxc configuration repository])
 AH_TEMPLATE([LXCLIBEXECDIR], [lxc executable library path])
+AH_TEMPLATE([LXCROOTFSMOUNT], [lxc default rootfs mount point])
 AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
 AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR")
+AC_DEFINE_UNQUOTED(LXCROOTFSMOUNT, "$LXCROOTFSMOUNT")
 
 AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
  [],
-- 
1.6.3.3


--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [PATCH 4/5] add lxc.rootfs.mount config option

2010-05-12 Thread Daniel Lezcano
From: Daniel Lezcano 

Define lxc.rootfs.mount option in order to override the default
mount point for rootfs.

Signed-off-by: Daniel Lezcano 
---
 src/lxc/conf.h|1 +
 src/lxc/confile.c |   18 ++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/lxc/conf.h b/src/lxc/conf.h
index 14c931d..8451266 100644
--- a/src/lxc/conf.h
+++ b/src/lxc/conf.h
@@ -170,6 +170,7 @@ struct lxc_console {
  */
 struct lxc_rootfs {
char *path;
+   char *mount;
char *pivot;
 };
 
diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index dd9f2cb..8c1b3dd 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -48,6 +48,7 @@ static int config_tty(const char *, char *, struct lxc_conf 
*);
 static int config_cgroup(const char *, char *, struct lxc_conf *);
 static int config_mount(const char *, char *, struct lxc_conf *);
 static int config_rootfs(const char *, char *, struct lxc_conf *);
+static int config_rootfs_mount(const char *, char *, struct lxc_conf *);
 static int config_pivotdir(const char *, char *, struct lxc_conf *);
 static int config_utsname(const char *, char *, struct lxc_conf *);
 static int config_network_type(const char *, char *, struct lxc_conf *);
@@ -77,6 +78,7 @@ static struct config config[] = {
{ "lxc.tty",  config_tty  },
{ "lxc.cgroup",   config_cgroup   },
{ "lxc.mount",config_mount},
+   { "lxc.rootfs.mount", config_rootfs_mount },
{ "lxc.rootfs",   config_rootfs   },
{ "lxc.pivotdir", config_pivotdir },
{ "lxc.utsname",  config_utsname  },
@@ -652,6 +654,22 @@ static int config_rootfs(const char *key, char *value, 
struct lxc_conf *lxc_conf
return 0;
 }
 
+static int config_rootfs_mount(const char *key, char *value, struct lxc_conf 
*lxc_conf)
+{
+   if (strlen(value) >= MAXPATHLEN) {
+   ERROR("%s path is too long", value);
+   return -1;
+   }
+
+   lxc_conf->rootfs.mount = strdup(value);
+   if (!lxc_conf->rootfs.mount) {
+   SYSERROR("failed to duplicate string '%s'", value);
+   return -1;
+   }
+
+   return 0;
+}
+
 static int config_pivotdir(const char *key, char *value, struct lxc_conf 
*lxc_conf)
 {
if (strlen(value) >= MAXPATHLEN) {
-- 
1.6.3.3


--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [PATCH 5/5] use defined rootfs mount point

2010-05-12 Thread Daniel Lezcano
From: Daniel Lezcano 

As we defined a path where to mount the rootfs, we can use without
ambiguity because it is defined by default at compile time or by the
configuration.

Signed-off-by: Daniel Lezcano 
---
 src/lxc/conf.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 55eb715..2b8ddf4 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -582,19 +582,22 @@ static int setup_rootfs_pivot_root(const char *rootfs, 
const char *pivotdir)
 
 static int setup_rootfs(const struct lxc_rootfs *rootfs)
 {
-   const char *tmpfs = "/tmp";
+   char *mpath = LXCROOTFSMOUNT;
 
if (!rootfs->path)
return 0;
 
-   if (mount(rootfs->path, tmpfs, "none", MS_BIND|MS_REC, NULL)) {
-   SYSERROR("failed to mount '%s'->'%s'", rootfs->path, "/tmp");
+   if (rootfs->mount)
+   mpath = rootfs->mount;
+
+   if (mount(rootfs->path, mpath, "none", MS_BIND|MS_REC, NULL)) {
+   SYSERROR("failed to mount '%s'->'%s'", rootfs->path, mpath);
return -1;
}
 
-   DEBUG("mounted '%s' on '%s'", rootfs->path, tmpfs);
+   DEBUG("mounted '%s' on '%s'", rootfs->path, mpath);
 
-   if (setup_rootfs_pivot_root(tmpfs, rootfs->pivot)) {
+   if (setup_rootfs_pivot_root(mpath, rootfs->pivot)) {
ERROR("failed to pivot_root to '%s'", rootfs->pivot);
return -1;
}
-- 
1.6.3.3


--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [PATCH 3/5] encapsulate rootfs data in a structure

2010-05-12 Thread Daniel Lezcano
From: Daniel Lezcano 

We have pivot_dir and rootfs defined in lxc_conf structure.
Let's encapsulate them in a rootfs structure.

Signed-off-by: Daniel Lezcano 
---
 src/lxc/conf.c|   32 +---
 src/lxc/conf.h|   14 --
 src/lxc/confile.c |8 
 src/lxc/console.c |6 +++---
 src/lxc/utmp.c|6 +++---
 5 files changed, 39 insertions(+), 27 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 2575413..55eb715 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -374,7 +374,8 @@ static int setup_utsname(struct utsname *utsname)
return 0;
 }
 
-static int setup_tty(const char *rootfs, const struct lxc_tty_info *tty_info)
+static int setup_tty(const struct lxc_rootfs *rootfs,
+const struct lxc_tty_info *tty_info)
 {
char path[MAXPATHLEN];
int i;
@@ -384,7 +385,7 @@ static int setup_tty(const char *rootfs, const struct 
lxc_tty_info *tty_info)
struct lxc_pty_info *pty_info = &tty_info->pty_info[i];
 
snprintf(path, sizeof(path), "%s/dev/tty%d",
-rootfs ? rootfs : "", i + 1);
+rootfs->path ? rootfs->path : "", i + 1);
 
/* At this point I can not use the "access" function
 * to check the file is present or not because it fails
@@ -579,22 +580,22 @@ static int setup_rootfs_pivot_root(const char *rootfs, 
const char *pivotdir)
return 0;
 }
 
-static int setup_rootfs(const char *rootfs, const char *pivotdir)
+static int setup_rootfs(const struct lxc_rootfs *rootfs)
 {
const char *tmpfs = "/tmp";
 
-   if (!rootfs)
+   if (!rootfs->path)
return 0;
 
-   if (mount(rootfs, tmpfs, "none", MS_BIND|MS_REC, NULL)) {
-   SYSERROR("failed to mount '%s'->'%s'", rootfs, "/tmp");
+   if (mount(rootfs->path, tmpfs, "none", MS_BIND|MS_REC, NULL)) {
+   SYSERROR("failed to mount '%s'->'%s'", rootfs->path, "/tmp");
return -1;
}
 
-   DEBUG("mounted '%s' on '%s'", rootfs, tmpfs);
+   DEBUG("mounted '%s' on '%s'", rootfs->path, tmpfs);
 
-   if (setup_rootfs_pivot_root(tmpfs, pivotdir)) {
-   ERROR("failed to pivot_root to '%s'", rootfs);
+   if (setup_rootfs_pivot_root(tmpfs, rootfs->pivot)) {
+   ERROR("failed to pivot_root to '%s'", rootfs->pivot);
return -1;
}
 
@@ -640,16 +641,17 @@ out:
return 0;
 }
 
-static int setup_console(const char *rootfs, const struct lxc_console *console)
+static int setup_console(const struct lxc_rootfs *rootfs,
+const struct lxc_console *console)
 {
char path[MAXPATHLEN];
struct stat s;
 
/* We don't have a rootfs, /dev/console will be shared */
-   if (!rootfs)
+   if (!rootfs->path)
return 0;
 
-   snprintf(path, sizeof(path), "%s/dev/console", rootfs);
+   snprintf(path, sizeof(path), "%s/dev/console", rootfs->path);
 
if (access(path, F_OK)) {
WARN("rootfs specified but no console found");
@@ -1415,17 +1417,17 @@ int lxc_setup(const char *name, struct lxc_conf 
*lxc_conf)
return -1;
}
 
-   if (setup_console(lxc_conf->rootfs, &lxc_conf->console)) {
+   if (setup_console(&lxc_conf->rootfs, &lxc_conf->console)) {
ERROR("failed to setup the console for '%s'", name);
return -1;
}
 
-   if (setup_tty(lxc_conf->rootfs, &lxc_conf->tty_info)) {
+   if (setup_tty(&lxc_conf->rootfs, &lxc_conf->tty_info)) {
ERROR("failed to setup the ttys for '%s'", name);
return -1;
}
 
-   if (setup_rootfs(lxc_conf->rootfs, lxc_conf->pivotdir)) {
+   if (setup_rootfs(&lxc_conf->rootfs)) {
ERROR("failed to set rootfs for '%s'", name);
return -1;
}
diff --git a/src/lxc/conf.h b/src/lxc/conf.h
index d0232db..14c931d 100644
--- a/src/lxc/conf.h
+++ b/src/lxc/conf.h
@@ -163,6 +163,17 @@ struct lxc_console {
 };
 
 /*
+ * Defines a structure to store the rootfs location, the
+ * optionals pivot_root, rootfs mount paths
+ * @rootfs : a path to the rootfs
+ * @pivot_root : a path to a pivot_root location to be used
+ */
+struct lxc_rootfs {
+   char *path;
+   char *pivot;
+};
+
+/*
  * Defines the global container configuration
  * @rootfs : root directory to run the container
  * @pivotdir   : pivotdir path, if not set default will be used
@@ -178,8 +189,6 @@ struct lxc_console {
  * @console: console data
  */
 struct lxc_conf {
-   char *rootfs;
-   char *pivotdir;
char *fstab;
int tty;
int pts;
@@ -191,6 +200,7 @@ struct lxc_conf {
struct lxc_list caps;
struct lxc_tty_info tty_info;
struct lxc_console console;
+   struct lxc_rootfs rootfs;
 };
 
 /*
diff --git a/src/lxc/confile.c b/src/lx

[lxc-devel] Containerized syslog

2010-05-12 Thread Jean-Philippe Menil

Hi,

I'm playing with containers under debian (squeeze, 2.6.33.3) with the 
lxc tools.
I'm really happy about all the features (attach veth on bridge, filter 
with iptables inside the containers, etc ...), and i was thinking to 
replace some of our vservers (and maybe some of our kvm) with this solution.


But actually, i experiment a problem with the iptables logs:
i've iptables on the host to filter some container, basically a squid 
proxy. I've another container who act as router, and he has his own 
iptables inside.

All the log are deported to a dedicated syslog server.
It appear that, the iptables log of the host are also deported by the 
syslog container (proxy).


Some of our guest (container, vserver, etc ) are administer by other 
sys-admin, that should not have access to theses informations.


This point is blocking me today, before going into production with 
containers.


I've seen some patch made by Jean-Marc Pigeon about this problem,
but they have not been commited.

Is there any reason for that?
Can someone advice me to circumvent this problem?

Thanks a lot.

Regards.
<>--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [PATCH 1/2] remove pivotdir only if it was created by us

2010-05-12 Thread Ferenc Wagner
The removal does not account for possible leading path components that
were also created during creation of pivotdir.

Signed-off-by: Ferenc Wagner 
---
 src/lxc/conf.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 2b8ddf4..6d9b6b0 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -464,6 +464,7 @@ static int setup_rootfs_pivot_root(const char *rootfs, 
const char *pivotdir)
void *cbparm[2];
struct lxc_list mountlist, *iterator;
int ok, still_mounted, last_still_mounted;
+   int remove_pivotdir = 0;
 
/* change into new root fs */
if (chdir(rootfs)) {
@@ -484,6 +485,7 @@ static int setup_rootfs_pivot_root(const char *rootfs, 
const char *pivotdir)
return -1;
}
 
+   remove_pivotdir = 1;
DEBUG("created '%s' directory", path);
}
 
@@ -573,8 +575,8 @@ static int setup_rootfs_pivot_root(const char *rootfs, 
const char *pivotdir)
 
/* remove temporary mount point, we don't consider the removing
 * as fatal */
-   if (rmdir(pivotdir))
-   WARN("can't remove mountpoint: %m");
+   if (remove_pivotdir && rmdir(pivotdir))
+   WARN("can't remove mountpoint '%s': %m", pivotdir);
 
INFO("pivoted to '%s'", rootfs);
return 0;
-- 
1.6.5


--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [PATCH 2/2] fix typos in error messages

2010-05-12 Thread Ferenc Wagner
Signed-off-by: Ferenc Wagner 
---
 src/lxc/conf.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 6d9b6b0..4d0223e 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -468,7 +468,7 @@ static int setup_rootfs_pivot_root(const char *rootfs, 
const char *pivotdir)
 
/* change into new root fs */
if (chdir(rootfs)) {
-   SYSERROR("can't chroot to new rootfs '%s'", rootfs);
+   SYSERROR("can't chdir to new rootfs '%s'", rootfs);
return -1;
}
 
@@ -499,7 +499,7 @@ static int setup_rootfs_pivot_root(const char *rootfs, 
const char *pivotdir)
}
 
if (chdir("/")) {
-   SYSERROR("can't chroot to / after pivot_root");
+   SYSERROR("can't chdir to / after pivot_root");
return -1;
}
 
-- 
1.6.5


--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] lxc-start leaves temporary pivot dir behind

2010-05-12 Thread Ferenc Wagner
Daniel Lezcano  writes:

> Ferenc Wagner wrote:
>
>> Daniel Lezcano  writes:
>>   
>>> Ferenc Wagner wrote:
>>> 
 Actually, I'm not sure you can fully solve this.  If rootfs is a
 separate file system, this is only much ado about nothing.  If rootfs
 isn't a separate filesystem, you can't automatically find a good
 place and also clean it up.
>>>
>>> Maybe a single /tmp/lxc directory may be used as the mount points are
>>> private to the container. So it would be acceptable to have a single
>>> directory for N containers, no ?
>>
>> Then why not /usr/lib/lxc/pivotdir or something like that?  Such a
>> directory could belong to the lxc package and not clutter up /tmp.  As
>> you pointed out, this directory would always be empty in the outer name
>> space, so a single one would suffice.  Thus there would be no need
>> cleaning it up, either.
>
> Agree. Shall we consider $(prefix)/var/run/lxc ?

Hmm, /var/run/lxc is inconvenient, because it disappears on each reboot
if /var/run is on tmpfs.  This isn't variable data either, that's why I
recommended /usr above.

>> Now the question is: if rootfs is a separate file system (which
>> includes bind mounts), is the superfluous rbind of the original root
>> worth skipping, or should we just do it to avoid needing an extra
>> code path?
>
> Good question. IMO, skipping the rbind is ok for this case but it may
> be interesting from a coding point of view to have a single place
> identified for the rootfs (especially for mounting an image). I will
> cook a patchset to fix the rootfs location and then we can look at
> removing the superfluous rbind.

I'm testing your patchset now.  So far it seems to work as advertised.
-- 
Thanks,
Feri.

--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] Containerized syslog

2010-05-12 Thread Daniel Lezcano
Jean-Philippe Menil wrote:
> Hi,
>
> I'm playing with containers under debian (squeeze, 2.6.33.3) with the 
> lxc tools.
> I'm really happy about all the features (attach veth on bridge, filter 
> with iptables inside the containers, etc ...), and i was thinking to 
> replace some of our vservers (and maybe some of our kvm) with this 
> solution.
>
> But actually, i experiment a problem with the iptables logs:
> i've iptables on the host to filter some container, basically a squid 
> proxy. I've another container who act as router, and he has his own 
> iptables inside.
> All the log are deported to a dedicated syslog server.
> It appear that, the iptables log of the host are also deported by the 
> syslog container (proxy).
>
> Some of our guest (container, vserver, etc ) are administer by other 
> sys-admin, that should not have access to theses informations.
>
> This point is blocking me today, before going into production with 
> containers.
>
> I've seen some patch made by Jean-Marc Pigeon about this problem,
> but they have not been commited.

I thing a consensus was not reach. The big deal with syslog is netfilter 
logs in an interrupt context where it is difficult to find the right log 
buffer ring as we are not in the process context making possible to 
identify the namespace.

IMHO, there are two parts to implement, (1) multiple instances of 
/dev/log with a new ring buffer each time attached to the file and (2) 
add an iptables rules to specify the file to log. This approach allows 
to get rid of namespace (in all the cases the clone flags are exhausted 
now), and provides a generic mechanism for other use cases (eg. separate 
logs for iptables) different from a container specific problem.

This is from a kernel POV, but from the userspace POV, that will means 
the iptables rules in the vps configuration files should be modified, I 
don't know if it's acceptable.
> Is there any reason for that?
> Can someone advice me to circumvent this problem?
I don't know a workaround for this problem.

Thanks
  -- Daniel

--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] lxc-start leaves temporary pivot dir behind

2010-05-12 Thread Daniel Lezcano
Ferenc Wagner wrote:
> Daniel Lezcano  writes:
>
>   
>> Ferenc Wagner wrote:
>>
>> 
>>> Daniel Lezcano  writes:
>>>   
>>>   
 Ferenc Wagner wrote:
 
 
> Actually, I'm not sure you can fully solve this.  If rootfs is a
> separate file system, this is only much ado about nothing.  If rootfs
> isn't a separate filesystem, you can't automatically find a good
> place and also clean it up.
>   
 Maybe a single /tmp/lxc directory may be used as the mount points are
 private to the container. So it would be acceptable to have a single
 directory for N containers, no ?
 
>>> Then why not /usr/lib/lxc/pivotdir or something like that?  Such a
>>> directory could belong to the lxc package and not clutter up /tmp.  As
>>> you pointed out, this directory would always be empty in the outer name
>>> space, so a single one would suffice.  Thus there would be no need
>>> cleaning it up, either.
>>>   
>> Agree. Shall we consider $(prefix)/var/run/lxc ?
>> 
>
> Hmm, /var/run/lxc is inconvenient, because it disappears on each reboot
> if /var/run is on tmpfs.  This isn't variable data either, that's why I
> recommended /usr above.
>   
Good point. I will change that to /usr/$(libdir)/lxc and let the distro 
maintainer to choose a better place if he wants with the configure option.

>>> Now the question is: if rootfs is a separate file system (which
>>> includes bind mounts), is the superfluous rbind of the original root
>>> worth skipping, or should we just do it to avoid needing an extra
>>> code path?
>>>   
>> Good question. IMO, skipping the rbind is ok for this case but it may
>> be interesting from a coding point of view to have a single place
>> identified for the rootfs (especially for mounting an image). I will
>> cook a patchset to fix the rootfs location and then we can look at
>> removing the superfluous rbind.
>> 
>
> I'm testing your patchset now.  So far it seems to work as advertised.
>   
Cool, thanks for testing.


--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [PATCH 1/2] remove pivotdir only if it was created by us

2010-05-12 Thread Daniel Lezcano
Ferenc Wagner wrote:
> The removal does not account for possible leading path components that
> were also created during creation of pivotdir.
>
> Signed-off-by: Ferenc Wagner 
> ---
>   
+1

--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [GIT] lxc branch, master, updated. 9232212afdad25536afc8d241606e00eac3b0c87

2010-05-12 Thread Daniel Lezcano
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "lxc".

The branch, master has been updated
   via  9232212afdad25536afc8d241606e00eac3b0c87 (commit)
   via  a91d897a7b5ef5ef07ede977fa35d5895947665a (commit)
   via  b1789442d69eb756355a53316c9dca4b74671883 (commit)
   via  23b7ea696bd3158ec7a0dd88cafa169e63fc8ad3 (commit)
   via  33fcb7a0477ed37523f05e0a083046eea166acf0 (commit)
   via  196db713a9ab0479d1e695aa428577abedcbfa58 (commit)
   via  288063bd0756250ffb9a736fa075acba2249202e (commit)
  from  25368b5249509aa21167b7ea4193e281f0091f55 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 9232212afdad25536afc8d241606e00eac3b0c87
Author: Ferenc Wagner 
Date:   Wed May 12 23:47:55 2010 +0200

fix typos in error messages

Signed-off-by: Ferenc Wagner 
Signed-off-by: Daniel Lezcano 

commit a91d897a7b5ef5ef07ede977fa35d5895947665a
Author: Ferenc Wagner 
Date:   Wed May 12 23:47:55 2010 +0200

remove pivotdir only if it was created by us

The removal does not account for possible leading path components that
were also created during creation of pivotdir.

Signed-off-by: Ferenc Wagner 
Signed-off-by: Daniel Lezcano 

commit b1789442d69eb756355a53316c9dca4b74671883
Author: Daniel Lezcano 
Date:   Wed May 12 23:44:28 2010 +0200

use defined rootfs mount point

As we defined a path where to mount the rootfs, we can use without
ambiguity because it is defined by default at compile time or by the
configuration.

Signed-off-by: Daniel Lezcano 

commit 23b7ea696bd3158ec7a0dd88cafa169e63fc8ad3
Author: Daniel Lezcano 
Date:   Wed May 12 23:44:28 2010 +0200

add lxc.rootfs.mount config option

Define lxc.rootfs.mount option in order to override the default
mount point for rootfs.

Signed-off-by: Daniel Lezcano 

commit 33fcb7a0477ed37523f05e0a083046eea166acf0
Author: Daniel Lezcano 
Date:   Wed May 12 23:44:28 2010 +0200

encapsulate rootfs data in a structure

We have pivot_dir and rootfs defined in lxc_conf structure.
Let's encapsulate them in a rootfs structure.

Signed-off-by: Daniel Lezcano 

commit 196db713a9ab0479d1e695aa428577abedcbfa58
Author: Daniel Lezcano 
Date:   Wed May 12 23:44:28 2010 +0200

add a configure option to set a rootfs mount point

Add a configure option to set a mount point path when using a rootfs,
that will replace the actual behavior which creates uneeded /tmp/lxc**
directories.

Signed-off-by: Daniel Lezcano 

commit 288063bd0756250ffb9a736fa075acba2249202e
Author: Daniel Lezcano 
Date:   Wed May 12 23:44:28 2010 +0200

whitespace cleanup in configure.ac

Mindless changes by removing whitespace.

Signed-off-by: Daniel Lezcano 

---

Summary of changes:
 configure.ac  |   23 ---
 src/lxc/conf.c|   53 +
 src/lxc/conf.h|   15 +--
 src/lxc/confile.c |   26 ++
 src/lxc/console.c |6 +++---
 src/lxc/utmp.c|6 +++---
 6 files changed, 90 insertions(+), 39 deletions(-)


hooks/post-receive
-- 
lxc

--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [PATCH 1/2] remove pivotdir only if it was created by us

2010-05-12 Thread Daniel Lezcano
Ferenc Wagner wrote:
> The removal does not account for possible leading path components that
> were also created during creation of pivotdir.
>
> Signed-off-by: Ferenc Wagner 
> ---
>   
Applied.

--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [PATCH 2/2] fix typos in error messages

2010-05-12 Thread Daniel Lezcano
Ferenc Wagner wrote:
> Signed-off-by: Ferenc Wagner 
> ---
>   
Applied thanks.

--

___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel