Wait for existence of wayland socket before changing its permissions.
authorOssama Othman <ossama.othman@intel.com>
Wed, 6 Feb 2013 23:07:12 +0000 (15:07 -0800)
committerOssama Othman <ossama.othman@intel.com>
Fri, 19 Apr 2013 22:59:50 +0000 (15:59 -0700)
Change-Id: If0128ac1b1ec533d7112692f5ce1a35da3099392
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
packaging/rc.weston

index 5b86cc5..c769bc1 100644 (file)
@@ -92,7 +92,15 @@ do_start()
        # appropriate --user flag.  Unfortunately, weston-launch isn't
        # available due to missing package dependencies.
        # ************************************************************
-       chmod 777 $XDG_RUNTIME_DIR/wayland-0
+       wayland_socket="$XDG_RUNTIME_DIR/wayland-0"
+       MAX_ATTEMPTS=8
+       attempt=0
+       while [ ! -f $wayland_socket ] && [ $attempt -lt $MAX_ATTEMPTS ]
+       do
+               sleep 0.5
+               attempt=$[$attempt + 1]
+       done
+       chmod 777 $wayland_socket
 
        # ***********************************************************
        # HACK TO WORK AROUND BROKEN INFINITE LOOPS IN BOOT ANIMATION