summaryrefslogtreecommitdiff
path: root/meta/packages/x11-common/xserver-nodm-init
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-05-27 11:45:22 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2009-05-27 11:45:22 +0100
commit6ed027a31fe3b400e8f7b1f0b418672f67acff24 (patch)
tree6ae14a90518eee1c1f98b171a141a266b4d27910 /meta/packages/x11-common/xserver-nodm-init
parent8f32595f6b8ed885a8291b1eb5cd671ece4b7d58 (diff)
downloadopenembedded-core-6ed027a31fe3b400e8f7b1f0b418672f67acff24.tar.gz
openembedded-core-6ed027a31fe3b400e8f7b1f0b418672f67acff24.tar.bz2
openembedded-core-6ed027a31fe3b400e8f7b1f0b418672f67acff24.tar.xz
openembedded-core-6ed027a31fe3b400e8f7b1f0b418672f67acff24.zip
xserver-nodm-init: Add ability to run X as a non-root user
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/packages/x11-common/xserver-nodm-init')
-rwxr-xr-xmeta/packages/x11-common/xserver-nodm-init/xserver-nodm9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/packages/x11-common/xserver-nodm-init/xserver-nodm b/meta/packages/x11-common/xserver-nodm-init/xserver-nodm
index f6399fc1f..69ea94972 100755
--- a/meta/packages/x11-common/xserver-nodm-init/xserver-nodm
+++ b/meta/packages/x11-common/xserver-nodm-init/xserver-nodm
@@ -26,8 +26,15 @@ done
case "$1" in
start)
. /etc/profile
+ username=root
echo "Starting Xserver"
- /etc/X11/Xserver &
+ if [ -f /etc/X11/Xusername ]; then
+ username=`cat /etc/X11/Xusername`
+ fi
+ # Using sudo -i here has the nice side effect of making sire
+ # HOME, USER and other previously problematic variables
+ # are set correctly
+ sudo -b -i -u $username /etc/X11/Xserver
# Wait for the desktop to say its finished loading
dbus-wait org.matchbox_project.desktop Loaded
;;