[lxc-devel] [PATCH] lxc_cgroup_append_task_3of3()

2011-10-06 Thread Axel Schöner
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

[lxc-devel] [PATCH] lxc_cgroup_append_task_2of3() helper_2of2

2011-10-06 Thread Axel Schöner
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,

[lxc-devel] [PATCH] lxc_cgroup_append_task_1of3() helper_1of2

2011-10-06 Thread Axel Schöner
} + } + } + 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'

[lxc-devel] [PATCH] Importance for adding pids of lxc-attach to the cgroup of container

2011-10-05 Thread Axel Schöner
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

[lxc-devel] [Lxc-devel] [PATCH 5/5] Again: Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
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

[lxc-devel] [Lxc-devel] [PATCH 2/5] Again: Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
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,

[lxc-devel] [Lxc-devel] [PATCH 3/5] Again: Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
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

[lxc-devel] [Lxc-devel] [PATCH 4/5] Again: Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
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

[lxc-devel] [Lxc-devel] [PATCH 1/5] Again: Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
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-devel] [Lxc-devel] [PATCH 5/5] Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
--- 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-devel] [Lxc-devel] [PATCH 4/5] Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
--- 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-devel] [Lxc-devel] [PATCH 3/5] Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
--- 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-devel] [Lxc-devel] [PATCH 2/5] Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
--- 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,

[lxc-devel] [Lxc-devel] [PATCH 1/5] Add pids of lxc-attach to the cgroup of container

2011-10-02 Thread Axel Schöner
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

[lxc-devel] PAM-module for adhoc creation of container

2011-09-02 Thread 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