Quoting Dan Kegel (d...@kegel.com): > On Thu, Aug 23, 2012 at 1:50 PM, Dan Kegel <d...@kegel.com> wrote: > > On Thu, Aug 23, 2012 at 1:32 PM, Dan Kegel <d...@kegel.com> wrote: > >> at the start of a build, use lxc-start-ephemeral -d to start the > >> ephemeral container, > > > > It's somewhat annoying to parse out the name of the > > ephemeral container from the log. Is there a right > > way to get it? (Or can it be passed in as a parameter?) > > Here's a little demo. Please poke holes in it and tell me how to > really do this :-) > > #!/bin/sh > sudo lxc-start-ephemeral -o test-container2 -d > log 2>&1 > while ! grep "is running" log > do > sleep 1 > done > container=`awk '/is running/ {print $1}' log` > sudo chroot /var/lib/lxc/$container/rootfs touch /xyzzy > sudo chroot /var/lib/lxc/$container/rootfs ls -l /xyzzy > sudo lxc-stop --name $container
I think you're better off submitting a patch to make lxc-start-ephemeral work better for you. I.e. an option to have it print the container name to a file, or have it optionally internally use lxc-console instead of ssh, etc. In other words you don't have to hack around its shortcomings, feel free to address them instead. Once you're sure exactly what you need. -serge ------------------------------------------------------------------------------ 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