[Lxc-users] Questions on lxc-execute
Have few questions on lxc-execute : 1) Getting an error as : [r...@guhan-fedora lxc]# lxc-execute --name=centos /bin/bash lxc-execute: No such file or directory - failed to exec /usr/libexec/lxc-init [r...@guhan-fedora lxc]# lxc-execute --name=centos -- /bin/bash lxc-execute: No such file or directory - failed to exec /usr/libexec/lxc-init [r...@guhan-fedora lxc]# ls -l /usr/libexec/lxc-init -rwxr-xr-x. 1 root root 8004 2010-02-17 21:38 /usr/libexec/lxc-init 2) Can the container run only one application at a time - such as one instance of lxc-execute ? So do I have to create multiple containers if I have to lxc-execute multiple applications or if I want to run lxc-start and lxc-execute in parallel ? From the man pages, it looks like the case but please clarify. 3) Related to #2 above. While I can understand multiple lxc-start does not make sense, any reason for preventing two lxc-execute? Thanks, Nirmal -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] Questions on lxc-execute
On 06/03/2010 09:51 AM, Nirmal Guhan wrote: Have few questions on lxc-execute : 1) Getting an error as : [r...@guhan-fedora lxc]# lxc-execute --name=centos /bin/bash lxc-execute: No such file or directory - failed to exec /usr/libexec/lxc-init [r...@guhan-fedora lxc]# lxc-execute --name=centos -- /bin/bash lxc-execute: No such file or directory - failed to exec /usr/libexec/lxc-init [r...@guhan-fedora lxc]# ls -l /usr/libexec/lxc-init -rwxr-xr-x. 1 root root 8004 2010-02-17 21:38 /usr/libexec/lxc-init hmm .. ? weird. Can you give a strace -f please ? Wasn't the container previously created and, if yes, did you specified a rootfs which may not contain /bin/bash ? 2) Can the container run only one application at a time - such as one instance of lxc-execute ? No you can run thousand of them but you need to specify different names. lxc-execute -n foo1 /bin/bash lxc-execute -n foo2 /bin/bash etc ... So do I have to create multiple containers if I have to lxc-execute multiple applications Not necessarily, you can call lxc-execute with a configuration file, without creating the container before. or if I want to run lxc-start and lxc-execute in parallel ? From the man pages, it looks like the case but please clarify. You can launch any numbers of containers you want. It is up to you to define the right configuration for each container you launch in order to prevent resources overlaps and conflicts. I was able to spawned 1000 applications on the same host simultaneously, as well as launching 100 debian containers with a btrfs cow filesystem. Thanks -- Daniel -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] Questions on lxc-execute
On 06/03/2010 06:24 PM, Nirmal Guhan wrote: Forgot to mention previously that I am able to successfully do lxc-start on the same container and /bin/bash is also part of rootfs. Here is the strace output (pretty long). Failure seems to be at : [pid 2386] execve(/usr/libexec/lxc-init, [/usr/libexec/lxc-init, --, /bin/bash], [/* 26 vars */]) = -1 ENOENT (No such file or directory) [pid 2386] gettimeofday({1275567472, 880216}, NULL) = 0 [pid 2386] write(2, lxc-execute: , 13lxc-execute: ) = 13 [pid 2386] write(2, No such file or directory - fail..., 64No such file or directory - failed to exec /usr/libexec/lxc-init) = 64 [r...@guhan-fedora lxc]# file /usr/libexec/lxc-init /usr/libexec/lxc-init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped [r...@guhan-fedora lxc]# - Begin strace --- [ ... } [pid 2386] pivot_root(., ./lxc-oldrootfs-9mRXDz) = 0 lxc-init may not be present in the rootfs. IMO, you should try to start your container with lxc-start instead of lxc-execute. lxc-execute is mostly used for application containers which does share the file system. AFAICS, you setup a system container, so you may use the lxc-start command. The lxc-sshd script, is a good example on how to setup an application container with a rootfs. -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users