public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Otavio Salvador <otavio@ossystems.com.br>
To: OpenEmbedded Core Mailing List
	<openembedded-core@lists.openembedded.org>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Subject: [PATCH] mini-x-session: Fix runtime when using without session contents
Date: Fri,  1 Feb 2013 00:36:15 -0200	[thread overview]
Message-ID: <1359686175-28538-1-git-send-email-otavio@ossystems.com.br> (raw)

The script where behaving badly when the session directory does not
exist and also lacking a dependency to 'sudo'. Instead of adding a
dependency on 'sudo' we use 'su' as done in xserver-common.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 .../mini-x-session/files/mini-x-session                | 18 ++++++++++--------
 .../mini-x-session/mini-x-session_0.1.bb               |  2 +-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/meta/recipes-graphics/mini-x-session/files/mini-x-session b/meta/recipes-graphics/mini-x-session/files/mini-x-session
index f7d6c3b..91f1592 100644
--- a/meta/recipes-graphics/mini-x-session/files/mini-x-session
+++ b/meta/recipes-graphics/mini-x-session/files/mini-x-session
@@ -17,14 +17,16 @@ exec /etc/mini_x/session
 fi
 
 MINI_X_SESSION_DIR=/etc/mini_x/session.d
-
-# Execute session file on behalf of file owner
-for SESSIONFILE in $MINI_X_SESSION_DIR/*; do
-    set +e
-    USERNAME=`stat -c %U $SESSIONFILE`
-    sudo -b -i -u $USERNAME $SESSIONFILE& 
-    set -e
-done
+if [ -d "$MINI_X_SESSION_DIR"]; then
+	# Execute session file on behalf of file owner
+	find $MINI_X_SESSION_DIR -type f | while read SESSIONFILE; do
+		set +e
+		USERNAME=`stat -c %U $SESSIONFILE`
+		# Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211]
+		su -l -c '$SESSIONFILE&' $USERNAME
+		set -e
+	done
+fi
 
 # This resolution is big enough for hob2's max window size.
 xrandr -s 1024x768
diff --git a/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb b/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb
index 6f7efb2..8106cbb 100644
--- a/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb
+++ b/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Mini X session files for poky"
 HOMEPAGE = "http://www.yoctoproject.org"
 BUGTRACKER = "http://bugzilla.pokylinux.org"
 
-PR = "r3"
+PR = "r4"
 
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://mini-x-session;endline=5;md5=b6430bffbcf05f9760e72938826b7487"
-- 
1.8.1




                 reply	other threads:[~2013-02-01  2:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359686175-28538-1-git-send-email-otavio@ossystems.com.br \
    --to=otavio@ossystems.com.br \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox