Quoting Dan Kegel (d...@kegel.com):
> On Thu, Aug 23, 2012 at 11:25 AM, Serge Hallyn
> <serge.hal...@canonical.com> wrote:
> > Is your main objection the extra time it takes for the distro-provided
> > init to run over lxc-init, or using separate commands as you mention
> > above?
> 
> I'm still trying to figure out my requirements, and how to use lxc.
> Buildbot runs normally take at least a minute, so anything
> under ten seconds might be ok.  My main concern was
> how to issue commands to run inside the ephemeral container.
> I can make do with running a single command, but buildbot
> kind of wants to run several commands during a run, so
> starting, issuing multiple commands from outside the container,
> and then stopping would be a natural fit.
> 
> > lxc-start-ephemeral takes arguments to execute, so you can
> > just do
> >
> >   lxc-start-ephemeral -o q1 -- ps -ef
> >
> > which will create the container, run the command, and destroy the container,
> 
> Sounds good, but when I try it, I get prompted for root's password:
> 
> $ time sudo lxc-create -t ubuntu -n test-container2
> ...
> real  0m5.970s   (nice!)
> $ sudo lxc-start-ephemeral -o test-container2 -- ps -ef
> Setting up ephemeral container...
> unable to write 'random state'
> Starting up the container...
> Warning: Permanently added '10.0.3.175' (ECDSA) to the list of known hosts.
> root@10.0.3.175's password:
> Permission denied, please try again.
> root@10.0.3.175's password:

right, so do '-u <yourusername>' and it'll ssh into the container as you
instead.  Or chroot into /var/lib/lxc/test-container2/rootfs and set
root's password.

> I had to reboot (lxc-stop wasn't enough?) and do lxc-destroy to get
> rid of the ephemeral container.
> 
> So I'm not sure it's working quite as you indicated.  This is all on
> ubuntu-12.04,
> $ dpkg-query -W lxc
> lxc   0.7.5-3ubuntu62
> 
> If you have a clue you could lend me, I'd be grateful.
> 
> > If you want to use lxc-init, it an lxc-execute-ephemeral shouldn't be too
> > hard to whip up.
> 
> Hopefully I can make do with what's already there, once I figure out
> how to use it.
> - Dan

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to