Re: [Lxc-users] Launch multiple apps in exactly on container

2010-09-17 Thread Jon Nordby
On 17 September 2010 06:55, Jue Hong hon...@gmail.com wrote:
 BKW, you're right. Now we're going to use the method as you say.
 But, being able to start apps outside is really convenient in some cases :)

It is. Before the kernel stuff for attach lands, you can use ssh for
this purpose as a workaround.

-- 
Regards Jon Nordby - www.jonnor.com

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Launch multiple apps in exactly on container

2010-09-17 Thread Nirmal Guhan
On Fri, Sep 17, 2010 at 3:33 AM, Jon Nordby jono...@gmail.com wrote:
 On 17 September 2010 06:55, Jue Hong hon...@gmail.com wrote:
 BKW, you're right. Now we're going to use the method as you say.
 But, being able to start apps outside is really convenient in some cases :)

 It is. Before the kernel stuff for attach lands, you can use ssh for
 this purpose as a workaround.

You mean ssh for a container started using lxc-execute? I was hoping
this was possible only if sshd was running within container (and
/sbin/init). I usually use lxc-execute to run a specific application
and wonder how ssh is possible. Please enlighten.

--Nirmal

 --
 Regards Jon Nordby - www.jonnor.com

 --
 Start uncovering the many advantages of virtual appliances
 and start using them to simplify application deployment and
 accelerate your shift to cloud computing.
 http://p.sf.net/sfu/novell-sfdev2dev
 ___
 Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Launch multiple apps in exactly on container

2010-09-16 Thread Daniel Lezcano
On 09/16/2010 09:36 AM, Jue Hong wrote:
 As I understand, running one application with the command lxc-execute
 will create a container instance. E.g., by running lxc-execute -n foo
 /bin/bash, a container named foo will be created, and I can find a foo
 directory under the mounted cgroup directory, like /dev/cgroup/foo.
 While retype lxc-execute -n foo /bin/bash, I'm told that:lxc-execute:
 Device or resource busy.

 Does it mean I cannot run multiple apps within exactly the same
 container foo via using lxc-execute or lxc-start? Or what should I do
 if it's possible?

The name is unique for the container. You can not start a container if 
it is already running. In your case you should do:

lxc-execute -n foo /bin/bash
lxc-execute -n bar /bin/bash

If you want to use the same configuration for both, you can supply these 
to the command line with the -f option.

lxc-execute -n foo -f lxc.conf /bin/bash
lxc-execute -n bar -f lxc.conf /bin/bash

You can also pass the configuration parameters with:

lxc-execute -n foo -s lxc.utsname=foo /bin/bash
lxc-execute -n bar -s lxc.utsname=bar /bin/bash

Cheers
   -- Daniel

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Launch multiple apps in exactly on container

2010-09-16 Thread Daniel Lezcano
On 09/16/2010 10:56 AM, Jue Hong wrote:
 Sure Daniel, what you say actually works. But I still want to know,
 whether I can launch another app into a running container.

 Doing as you say:

 lxc-execute -n foo /bin/bash  -- this bash runs inside container 'foo'
 lxc-execute -n bar /bin/bash  -- this bash runs inside container 'bar'
  
 the 2nd bash will run in a different container named 'bar': e.g.
 /dev/cgroup/bar.
 What if I want to launch another app, like helloworld, inside the
 first running container 'foo'?


Ah, ok. Sorry I misunderstood your question. This is not yet supported 
because there is a missing feature in the kernel.
Hopefully, the kernel modification providing this functionality is ready 
and the author said he will submit it this week or next week, so that 
will be possible in a near future.

This feature is very important because it allows build a set of scripts 
to facilitate container management from the outside like shutdown, 
netstat, etc ...

If you wish to experiment this feature, it is available at:

http://lxc.sourceforge.net/patches/linux/

and the command using it is lxc-attach, which is already available with 
the 0.7.2 version.

At this point, it's experimental but very usable. I will be happy to 
have feedbacks ;)

Thanks
   -- Daniel







--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Launch multiple apps in exactly on container

2010-09-16 Thread Jue Hong
Great news! I'll have a try.

Thank you Daniel!

On Thu, Sep 16, 2010 at 6:05 PM, Daniel Lezcano daniel.lezc...@free.fr wrote:
 On 09/16/2010 10:56 AM, Jue Hong wrote:

 Sure Daniel, what you say actually works. But I still want to know,
 whether I can launch another app into a running container.

 Doing as you say:


 lxc-execute -n foo /bin/bash  -- this bash runs inside container 'foo'
 lxc-execute -n bar /bin/bash  -- this bash runs inside container 'bar'


 the 2nd bash will run in a different container named 'bar': e.g.
 /dev/cgroup/bar.
 What if I want to launch another app, like helloworld, inside the
 first running container 'foo'?


 Ah, ok. Sorry I misunderstood your question. This is not yet supported
 because there is a missing feature in the kernel.
 Hopefully, the kernel modification providing this functionality is ready and
 the author said he will submit it this week or next week, so that will be
 possible in a near future.

 This feature is very important because it allows build a set of scripts to
 facilitate container management from the outside like shutdown, netstat, etc
 ...

 If you wish to experiment this feature, it is available at:

 http://lxc.sourceforge.net/patches/linux/

 and the command using it is lxc-attach, which is already available with the
 0.7.2 version.

 At this point, it's experimental but very usable. I will be happy to have
 feedbacks ;)

 Thanks
  -- Daniel










-- 
Jue Hong (洪爵)
Department of Network Infrastructure
Tencent Company, Shenzhen, China

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Launch multiple apps in exactly on container

2010-09-16 Thread Brian K. White
On 9/16/2010 3:36 AM, Jue Hong wrote:
 As I understand, running one application with the command lxc-execute
 will create a container instance. E.g., by running lxc-execute -n foo
 /bin/bash, a container named foo will be created, and I can find a foo
 directory under the mounted cgroup directory, like /dev/cgroup/foo.
 While retype lxc-execute -n foo /bin/bash, I'm told that:lxc-execute:
 Device or resource busy.

 Does it mean I cannot run multiple apps within exactly the same
 container foo via using lxc-execute or lxc-start? Or what should I do
 if it's possible?

You can run essentially as many apps as you want inside a single 
container, you just can't start them from the outside.

For a single service or app, run lxc-execute ... myapp

For multiple services/apps, run lxc-start , which will run /sbin/init 
inside the container, and init starts up multiple services the same way 
a regular server does.

You could do almost as much with lxc-execute.../bin/bash, but you do it 
from that shell, from inside the container, not by trying to run 
lxc-execute multiple times to create multiple processes.

-- 
bkw

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Launch multiple apps in exactly on container

2010-09-16 Thread Jue Hong
BKW, you're right. Now we're going to use the method as you say.
But, being able to start apps outside is really convenient in some cases :)

On Fri, Sep 17, 2010 at 12:47 AM, Brian K. White br...@aljex.com wrote:
 On 9/16/2010 3:36 AM, Jue Hong wrote:
 As I understand, running one application with the command lxc-execute
 will create a container instance. E.g., by running lxc-execute -n foo
 /bin/bash, a container named foo will be created, and I can find a foo
 directory under the mounted cgroup directory, like /dev/cgroup/foo.
 While retype lxc-execute -n foo /bin/bash, I'm told that:lxc-execute:
 Device or resource busy.

 Does it mean I cannot run multiple apps within exactly the same
 container foo via using lxc-execute or lxc-start? Or what should I do
 if it's possible?

 You can run essentially as many apps as you want inside a single
 container, you just can't start them from the outside.

 For a single service or app, run lxc-execute ... myapp

 For multiple services/apps, run lxc-start , which will run /sbin/init
 inside the container, and init starts up multiple services the same way
 a regular server does.

 You could do almost as much with lxc-execute.../bin/bash, but you do it
 from that shell, from inside the container, not by trying to run
 lxc-execute multiple times to create multiple processes.

 --
 bkw

 --
 Start uncovering the many advantages of virtual appliances
 and start using them to simplify application deployment and
 accelerate your shift to cloud computing.
 http://p.sf.net/sfu/novell-sfdev2dev
 ___
 Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users




-- 
Jue Hong (洪爵)
Department of Network Infrastructure
Tencent Company, Shenzhen, China

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users