[Devel] Re: [PATCH 1/1] namespaces: introduce sys_hijack (v11)

Bastian Blank bastian at waldi.eu.org
Fri Aug 1 02:23:18 PDT 2008


On Thu, Jul 31, 2008 at 01:32:13PM -0500, Serge E. Hallyn wrote:
> Introduce sys_hijack (for i386 and s390 only so far).  An open
> fd for a cgroup 'tasks' file is specified.  The main purpose
> is to allow entering an empty cgroup without having to keep a
> task alive in the target cgroup.

What is the problem if no task is alive in the target?

> The effect is a sort of namespace enter.  The following program
> uses sys_hijack to 'enter' all namespaces of the specified
> cgroup.

I currently fail to see what the differences to a normal cgroup attach
is.

>         For instance in one terminal, do
> 
> 	mount -t cgroup -ons cgroup /cgroup
> 	hostname
> 	  qemu
> 	ns_exec -u /bin/sh
> 	  hostname serge
>           echo $$
>             2996
> 	  cat /proc/$$/cgroup
> 	    ns:/node_2996
> 
> In another terminal then do
> 
> 	hostname
> 	  qemu
> 	cat /proc/$$/cgroup
> 	  ns:/
> 	hijack /cgroup/node_2996/tasks

Why can't this be done by a echo $$ >> /cgroup/node_2996/attach?

> 	  hostname
> 	    serge
> 	  cat /proc/$$/cgroup
> 	    ns:/node_2996

Bastian

-- 
Star Trek Lives!
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list