debian-add_ip.sh: support for Ubuntu 14.04

In Ubuntu 14.04, /etc/init.d/networking script was deliberately modified
to to work if init if upstart (which is the case), always returning 1
and doing nothing. So, we can't rely on it anymore, therefore adding an
IP to ubuntu-14.04-based container was not working as it should.

This patch is somewhat reverting commit 826a387, going back to using
ifdown and ifup. Now, that commit mentions that ifup -a is not working
because interface is not marked as "auto", but I am not able to
reproduce this now.

The following distros were tested:

	debian-3.1-x86 (IPv4 only)
	debian-4.0-x86_64
	debian-5.0-x86_64
	debian-6.0-x86_64
	debian-7.0-x86_64
	ubuntu-10.04-x86_64
	ubuntu-12.04-x86_64
	ubuntu-14.04-x86_64

Kernel used is 2.6.32-042stab092.2, maybe it makes some difference.

Testing scenarios included adding and removing IPv4 and IPv6
addresses, container restarts with and without configured IPs
etc. In particular, adding the first IP address is a specific
case as venet0 interface is not up.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed