Add a timeout option to lxc-wait

Bug #1020179 reported by Jean-Baptiste Lallement on 2012-07-02
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)

Bug Description

Current implementation of lxc-wait wait forever until the container reach a states passed in argument.
If for some reason the container hangs (in my case it was blocking while trying to bind mount a device) lxc-wait never exit the wait loop.

It'd be nice to have a timeout option and exit with a non-zero exit status if it reaches the timeout, something like:
lx-wait -d DURATION -n NAME -s STATE

It's a wishlist item, timeout from coreutils can be used for this purpose.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: lxc 0.8.0~rc1-4ubuntu17
ProcVersionSignature: Ubuntu 3.5.0-2.2-generic 3.5.0-rc4
Uname: Linux 3.5.0-2-generic x86_64
ApportVersion: 2.2.5-0ubuntu1
Architecture: amd64
Date: Mon Jul 2 18:05:24 2012
 PATH=(custom, user)
SourcePackage: lxc
UpgradeStatus: Upgraded to quantal on 2012-01-31 (152 days ago)

Jean-Baptiste Lallement (jibel) wrote :
Stéphane Graber (stgraber) wrote :

Serge added the timeout option to the wait() call in the API last week, so once we start rewritting the tools to use the API, we'll get that for free.

Changed in lxc (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Serge Hallyn (serge-hallyn) wrote :

Note there is also a patch (which I've Acked) upstream for adding the timeout to lxc-wait itself.

If it takes awhile yet for upstream to merge the patch or to do a new release or rc, we can pull that patch into our package.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.8.0~rc1-4ubuntu21

lxc (0.8.0~rc1-4ubuntu21) quantal; urgency=low

  [ Stéphane Graber ]
  * Fix lxc-ubuntu and lxc-ubuntu-cloud to fix the /dev/shm workaround to only
    trigger when /dev/shm is not a symlink. (LP: #974584)

  [ Serge Hallyn ]
  * lxc.lxc-net.upstart: replace the check for USE_LXC_BRIDGE (which could be
    changed from true to false after starting lxc-net) with one for the
    existence /var/run/lxc. (LP: #1019290)
  * 0095-lxc-clone-change-uuid-on-xfs.patch: give each cloned xfs-backed
    lvm partition a unique uuid so they can be mounted simultaneously.
    (LP: #1013549)
  * 0096-lxc-wait-add-timeout.patch: patch submitted upstream to add a timeout
    option to lxc-wait. (LP: #1020179)
 -- Serge Hallyn <email address hidden> Thu, 26 Jul 2012 17:40:36 +0000

Changed in lxc (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers