[Bug 1172566] Re: MAAS Server ISO install fails when network is disconnected
Scott Moser
smoser at ubuntu.com
Mon Apr 14 17:45:40 UTC 2014
so the bug here is actually in 'get_default_route_ip' of the postinst
for maas-region-controller-min and maas-region-controller.
They run with 'set -e' (which i'm never a fan of), and then have:
get_default_route_ip() {
while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT; do [ "$Mask" = "00000000" ] && break
done < /proc/net/route
interface="$Iface"
ipaddr=$(LC_ALL=C /sbin/ip -4 addr list dev "$interface" scope global)
ipaddr=${ipaddr#* inet }
ipaddr=${ipaddr%%/*}
echo $ipaddr
}
That method has many issues.
a.) will stomp over global variables 'iface' 'Destination' Gateway, Flags .... and 'interface'. luckily it is only run in a subshell, so thats not really a problem here.
b.) if interface is empty it runs : ip -4 addr list dev "" scope global
ip fails, thus the method fails, and thus the dpkg postinst fails
(thanks to set -e).
the simpllist fix is just to add:
[ -n "$interface" ] || return 0
right after the loop that reads /proc/net/route.
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to maas in Ubuntu.
https://bugs.launchpad.net/bugs/1172566
Title:
MAAS Server ISO install fails when network is disconnected
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-release-notes/+bug/1172566/+subscriptions
More information about the Ubuntu-server-bugs
mailing list