]> git.pld-linux.org Git - packages/lxd.git/commitdiff
- check bridge status before start
authormis <mis@pld-linux.org>
Mon, 22 Aug 2016 12:10:32 +0000 (14:10 +0200)
committermis <mis@pld-linux.org>
Mon, 22 Aug 2016 12:10:32 +0000 (14:10 +0200)
lxd.init

index 03fa8d043a80d3236a785f5def3acc3a5bd60b6b..9a13ce54f814a742a18be38c674b2ea254cc5edd 100755 (executable)
--- 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 
        
This page took 0.256243 seconds and 4 git commands to generate.