Patchwork mini-x-session: Fix starting of x-session

login
register
mail settings
Submitter Saul Wold
Date Feb. 26, 2013, 12:41 a.m.
Message ID <1361839310-1758-1-git-send-email-sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/45061/
State New
Headers show

Comments

Saul Wold - Feb. 26, 2013, 12:41 a.m.
We need to use sudo semantics since it does not start correctly
with su.

The test was constructed incorrectly.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/recipes-graphics/mini-x-session/files/mini-x-session | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Otavio Salvador - Feb. 26, 2013, 2:25 a.m.
On Mon, Feb 25, 2013 at 9:41 PM, Saul Wold <sgw@linux.intel.com> wrote:
> We need to use sudo semantics since it does not start correctly
> with su.
>
> The test was constructed incorrectly.
>
> Signed-off-by: Saul Wold <sgw@linux.intel.com>

Please add a rdepends on sudo in this case.

Patch

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 91f1592..dca655a 100644
--- a/meta/recipes-graphics/mini-x-session/files/mini-x-session
+++ b/meta/recipes-graphics/mini-x-session/files/mini-x-session
@@ -17,13 +17,14 @@  exec /etc/mini_x/session
 fi
 
 MINI_X_SESSION_DIR=/etc/mini_x/session.d
-if [ -d "$MINI_X_SESSION_DIR"]; then
+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
+#		su -l -c '$SESSIONFILE&' $USERNAME
+		sudo -b -i -u $USERNAME $SESSIONFILE&
 		set -e
 	done
 fi