diff --git a/src/lxc/lxc_attach.c b/src/lxc/lxc_attach.c
index ed3d5a4..65cb101 100644
--- a/src/lxc/lxc_attach.c
+++ b/src/lxc/lxc_attach.c
@@ -85,7 +85,7 @@ int main(int argc, char *argv[], char *envp[])
curdir = get_current_dir_name();
- ret = lxc_attach(pid);
+ ret = lxc
diff --git a/src/lxc/namespace.h b/src/lxc/namespace.h
index 9c6b7ec..cda6c50 100644
--- a/src/lxc/namespace.h
+++ b/src/lxc/namespace.h
@@ -49,6 +49,7 @@
#endif
extern pid_t lxc_clone(int (*fn)(void *), void *arg, int flags);
-extern int lxc_attach(pid_t pid);
+extern int lxc_attach(pid_t pid,
}
+ }
+ }
+ endmntent(file);
+ return err;
+}
+
int lxc_one_cgroup_destroy(const char *cgmnt, const char *name)
{
On Thursday, 6. October 2011 11:19:05 you wrote:
> On Wed, 2011-10-05 at 20:46 +0200, "Axel Schöner" wrote:
> > I'
52.7 0.0148 4 pts/1R18:05 0:19 burnP6
root 19224 49.9 0.0148 4 pts/1R+ 18:05 0:17 burnP6
Background:
I'm using "lxc-attach" by PAM to login a user into an adhoc created container,
console based an graphical. We intend to make the source code pub
diff --git a/src/lxc/lxc_attach.c b/src/lxc/lxc_attach.c
index ed3d5a4..65cb101 100644
--- a/src/lxc/lxc_attach.c
+++ b/src/lxc/lxc_attach.c
@@ -85,7 +85,7 @@ int main(int argc, char *argv[], char *envp[])
curdir = get_current_dir_name();
- ret = lxc_attach(pid);
+ ret = lxc
diff --git a/src/lxc/namespace.h b/src/lxc/namespace.h
index 9c6b7ec..cda6c50 100644
--- a/src/lxc/namespace.h
+++ b/src/lxc/namespace.h
@@ -49,6 +49,7 @@
#endif
extern pid_t lxc_clone(int (*fn)(void *), void *arg, int flags);
-extern int lxc_attach(pid_t pid);
+extern int lxc_attach(pid_t pid,
diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
index a2b823e..d86891b 100644
--- a/src/lxc/cgroup.c
+++ b/src/lxc/cgroup.c
@@ -265,6 +265,43 @@ out:
return err;
}
+/*
+ * for each mounted cgroup, get the cgroup for the container to append a task
+ */
+int lxc_cgroup_append_task(const c
diff --git a/src/lxc/cgroup.h b/src/lxc/cgroup.h
index 188d948..6669815 100644
--- a/src/lxc/cgroup.h
+++ b/src/lxc/cgroup.h
@@ -31,4 +31,5 @@ int lxc_cgroup_destroy(const char *name);
int lxc_cgroup_path_get(char **path, const char *subsystem, const char *name);
int lxc_cgroup_nrtasks(const char
Sorry my first patchset was not again a complete clean sourcedir ;-(.
I've done a new one, please discard the first one.
Axel Schöner
diff --git a/src/lxc/namespace.c b/src/lxc/namespace.c
index aca29d4..86d1e53 100644
--- a/src/lxc/namespace.c
+++ b/src/lxc/namespace.c
@@ -82,7 +82,7 @@
--- lxc_roh/src/lxc/lxc_attach.c2011-10-02 18:57:40.0 +0200
+++ lxc/src/lxc/lxc_attach.c2011-10-02 17:36:35.0 +0200
@@ -85,7 +85,7 @@
curdir = get_current_dir_name();
- ret = lxc_attach(pid);
+ ret = lxc_attach(pid, my_args.name);
if (ret
--- lxc_roh/src/lxc/cgroup.h2011-10-02 18:57:40.0 +0200
+++ lxc/src/lxc/cgroup.h2011-10-02 17:39:01.0 +0200
@@ -31,4 +31,5 @@
int lxc_cgroup_path_get(char **path, const char *subsystem, const char *name);
int lxc_cgroup_nrtasks(const char *name);
int lxc_ns_is_mounted
--- lxc_roh/src/lxc/cgroup.c2011-10-02 19:46:44.0 +0200
+++ lxc/src/lxc/cgroup.c2011-10-02 19:13:44.0 +0200
@@ -270,36 +270,36 @@
*/
int lxc_cgroup_append_task(const char *name, pid_t pid)
{
- struct mntent *mntent;
- FILE *file = NULL;
- int err =
--- lxc_roh/src/lxc/namespace.h 2011-10-02 18:57:40.0 +0200
+++ lxc/src/lxc/namespace.h 2011-10-02 19:41:23.0 +0200
@@ -49,6 +49,7 @@
#endif
extern pid_t lxc_clone(int (*fn)(void *), void *arg, int flags);
-extern int lxc_attach(pid_t pid);
+extern int lxc_attach(pid_t pid,
The patchset adds the pids of the lxc-attach process to the cgroup of the
corresponding container.
Because this is my first patch for lxc, someone should analyze it.
If you agree with the solution then integrate it.
If there is anything i should do better in future tell me please.
Axel Schöner
Possible solutions for the storage:
The storage for such a scenario could be realized with BTRFS OR AUFS to
minimize the needed space and make it easy to create and destroy the rootfs
for the instances.
Thanks for replies.
A
15 matches
Mail list logo