[packages/lxd] - check bridge status before start
mis
mis at pld-linux.org
Mon Aug 22 14:11:57 CEST 2016
commit 4ecaeaabc981c52f75c9e85a0da996265c897c01
Author: mis <mis at pld-linux.org>
Date: Mon Aug 22 14:10:32 2016 +0200
- check bridge status before start
lxd.init | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/lxd.init b/lxd.init
index 03fa8d0..9a13ce5 100755
--- a/lxd.init
+++ b/lxd.init
@@ -33,9 +33,18 @@ pidfile="/var/run/lxd.pid"
start() {
if status --pidfile $pidfile lxd lxd >/dev/null; then
msg_already_running "lxd"
+ RETVAL=1
return
fi
+ if [ -n "$BRIDGE_DEV" ]; then
+ if ! ip link show $BRIDGE_DEV 2>/dev/null | grep -q ",UP,"; then
+ nls "lxd bridge %s is down, start lxdbr service first" "$BRIDGE_DEV"
+ RETVAL=1
+ return
+ fi
+ fi
+
msg_starting "lxd"
daemon --fork --waitforname lxd /usr/sbin/lxd daemon $OPTIONS
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/lxd.git/commitdiff/218196491c360d838eebc673b5a195b43dc19c91
More information about the pld-cvs-commit
mailing list