← Back to team overview

touch-packages team mailing list archive

[Bug 1197754] Re: print lxc-start-ephemeral container name in a machine-readable way

 

stgraber@dakara:~/data/code/lxc/lxc$ lxc-start-ephemeral -o blah -d | grep "lxc-console" | awk '{print $NF}'
blah-psrfp_3s


Not the prettiest thing ever, but definitively doable with current lxc-start-ephemeral.
I won't be spending more time on lxc-start-ephemeral though as we'll have the new lxc-copy there soon that will take-over most if not all of it (lxc-start-ephemeral will likely be gone in 2.0).

So marking this fix-released as the above does work.

** Changed in: lxc (Ubuntu)
       Status: Triaged => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1197754

Title:
  print lxc-start-ephemeral container name in  a machine-readable way

Status in autopkgtest package in Ubuntu:
  Triaged
Status in lxc package in Ubuntu:
  Fix Released

Bug description:
  A script cannot call lxc-start-ephemeral and get a named container in
  a reliable, race-free way.

  Having the caller specify a name directly is racy, since the name
  could have been taken in between checking that it doesn't exist
  already and calling lxc-start-ephemeral.

  Allowing lxc-start-ephemeral allows it to take care of the mkdir (and
  retries) to generate an LXC container name in a race free manner, but
  this needs -d to return the name in a machine-readable way, so that we
  can create ephemeral LXC containers from scripts.

  Please add a machine-readable mechanism to "lxc-start-ephemeral -d"
  and then we can modify adt-virt-lxc to use it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/autopkgtest/+bug/1197754/+subscriptions