[lxc-devel] [PATCH] Fix wait_for_bridge() in sysvinit script

Stéphane Graber stgraber at ubuntu.com
Fri Apr 4 21:43:21 UTC 2014


On Fri, Apr 04, 2014 at 07:01:34PM +0200, Robert Vogelgesang wrote:
> Fix parsing of /etc/lxc/default.conf, i. e. ignore comments, and don't
> require whitespace left and right of the equal sign.
> 
> Make the early return actually work.
> 
> Signed-off-by: Robert Vogelgesang <vogel at users.sourceforge.net>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> 
> diff -up lxc-1.0.2/config/init/sysvinit/lxc.fix_wfb lxc-1.0.2/config/init/sysvinit/lxc
> --- lxc-1.0.2/config/init/sysvinit/lxc.fix_wfb	2014-03-27 20:10:48.000000000 +0100
> +++ lxc-1.0.2/config/init/sysvinit/lxc	2014-04-04 18:35:16.608924414 +0200
> @@ -27,8 +27,10 @@ wait_for_bridge()
>  {
>      [ -f /etc/lxc/default.conf ] || { return 0; }
>  
> -    BRNAME=`grep lxc.network.link /etc/lxc/default.conf |awk '{print $3}'`
> -    [ -n $BRNAME ] || { return 0; }
> +    BRNAME=`grep '^[ 	]*lxc.network.link' /etc/lxc/default.conf | sed 's/^.*=[ 	]*//'`
> +    if [ -z "$BRNAME" ]; then
> +	return 0
> +    fi
>  
>      for try in `seq 1 30`; do
>  	ifconfig -a |grep "^$BRNAME" >/dev/null 2>&1
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140404/65d61255/attachment.pgp>


More information about the lxc-devel mailing list