[lxc-devel] [PATCH] Make get_ips timeout poll configurable

John McFarlane john at rockfloat.com
Mon Jul 8 17:26:09 UTC 2013


Locally I find 5 seconds to be inadequate to reliably obtain the ip
address of a container.  This commit only adds an option, a subsequent
commit could increase the default (5) if that seems reasonable.

Signed-off-by: John McFarlane <john at rockfloat.com>
---
 src/lxc/lxc-start-ephemeral.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lxc/lxc-start-ephemeral.in b/src/lxc/lxc-start-ephemeral.in
index cb1f732..6123259 100644
--- a/src/lxc/lxc-start-ephemeral.in
+++ b/src/lxc/lxc-start-ephemeral.in
@@ -97,6 +97,9 @@ parser.add_argument("--union-type", "-U", type=str, default="overlayfs",
 parser.add_argument("--keep-data", "-k", action="store_true",
                     help=_("don't wipe everything clean at the end"))
 
+parser.add_argument("--get-ips-timeout", "-I", type=int, default=5,
+                    help=_("the timeout to use when polling get_ips"))
+
 parser.add_argument("command", metavar='CMD', type=str, nargs="*",
                     help=_("Run specific command in container "
                            "(command as argument)"))
@@ -273,7 +276,7 @@ if not args.command and not args.daemon:
     sys.exit(0)
 
 # Try to get the IP addresses
-ips = dest.get_ips(timeout=5)
+ips = dest.get_ips(timeout=args.get_ips_timeout)
 
 # Deal with the case where we just print info about the container
 if args.daemon:
-- 
1.8.1.2





More information about the lxc-devel mailing list