This version uses "echo" instead of "ls" to get the list of scripts in
/etc/X11/Xsession.d.

--- /etc/X11/Xsession.orig      2010-06-06 19:21:56.000000000 +0200
+++ /etc/X11/Xsession   2010-06-08 22:17:47.000000000 +0200
@@ -35,15 +35,16 @@
 # Can't use run-parts like this, busybox doesn't support it. Use ls instead
 #SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)

-SESSIONFILES=`ls -X $SYSSESSIONDIR`
-if [ -n "$SESSIONFILES" ]; then
-  for SESSIONFILE in $SESSIONFILES; do
-  # Test if script is executable first before sourcing it
-    if [ -x "$SYSSESSIONDIR/$SESSIONFILE" ]; then
-      . $SYSSESSIONDIR/$SESSIONFILE
-    fi
-  done
-fi
+SESSIONFILES=`echo $SYSSESSIONDIR/*`
+for SESSIONFILE in $SESSIONFILES; do
+  # only source it when it's executable
+  # when the directory is empty, you get one item $SYSSESSIONDIR/*,
+  # which is of course not executable
+  if [ -x "$SESSIONFILE" ]; then
+    # logger -t /etc/X11/Xsession "sourcing $SESSIONFILE"
+    . $SESSIONFILE
+  fi
+done

 exit 0
_______________________________________________
Shr-devel mailing list
[email protected]
http://lists.shr-project.org/mailman/listinfo/shr-devel

Reply via email to