]> git.pld-linux.org Git - packages/lxd.git/blobdiff - lxd.init
- up to 4.24
[packages/lxd.git] / lxd.init
index 9a13ce54f814a742a18be38c674b2ea254cc5edd..1404f8c4328e06e3da81f511dfe3dd2806a17abc 100755 (executable)
--- a/lxd.init
+++ b/lxd.init
@@ -36,29 +36,18 @@ start() {
                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 
+       daemon --fork --waitforname lxd /usr/lib/lxd-wrapper daemon $OPTIONS 
        
        # lxd does not write pidfile, so create one
        show "Checking lxd daemon status"
        busy
-       pid=""
-       ntry=0
-       while [ -z "$pid" -a $ntry -lt 5 ]; do
-               [ -z "$pid" ] && sleep 1
-               pid=$(lxc info 2>/dev/null | awk '/serverpid:/{print $2}')
-               [ -n "$pid" ] && echo $pid > $pidfile
-               ntry=$(($ntry+1))
-       done
+       
+       if lxd waitready --timeout=16 2>/dev/null; then
+           pid=$(lxc info 2>/dev/null | awk '/server_pid:/{print $2}')
+           [ -n "$pid" ] && echo $pid > $pidfile
+       fi 
 
        if [ -n "$pid" ]; then
                touch /var/lock/subsys/lxd
This page took 0.056289 seconds and 4 git commands to generate.