From 7535c28d8c8472e4ce04d01d4f0f4f04ad01b563 Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Wed, 6 Feb 2013 15:07:12 -0800 Subject: [PATCH] Wait for existence of wayland socket before changing its permissions. Change-Id: If0128ac1b1ec533d7112692f5ce1a35da3099392 Signed-off-by: Ossama Othman --- packaging/rc.weston | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packaging/rc.weston b/packaging/rc.weston index 5b86cc5..c769bc1 100644 --- a/packaging/rc.weston +++ b/packaging/rc.weston @@ -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 -- 2.7.4