[maemo-commits] [maemo-commits] r17016 - projects/haf/trunk/maemo-launcher/debian

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Dec 19 15:09:14 EET 2008
Author: guillem
Date: 2008-12-19 15:09:13 +0200 (Fri, 19 Dec 2008)
New Revision: 17016

Modified:
   projects/haf/trunk/maemo-launcher/debian/changelog
   projects/haf/trunk/maemo-launcher/debian/init.d
Log:
Revert "Export USER, LOGNAME, SHELL and HOME to maemo-launcher"

This reverts commit 253d2db0977bcfa0aeca0cce09c822162523ff6e,
commit 498d8ebc1376a60423e50a722d9db6656b8d2bba
and commit 3822a83524ff2f44e2ed46104558ca51f3d188dc.

Modified: projects/haf/trunk/maemo-launcher/debian/changelog
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/changelog	2008-12-19 12:59:49 UTC (rev 17015)
+++ projects/haf/trunk/maemo-launcher/debian/changelog	2008-12-19 13:09:13 UTC (rev 17016)
@@ -1,3 +1,9 @@
+maemo-launcher (0.31-3) unstable; urgency=low
+
+  * Revert "Export USER, LOGNAME, SHELL and HOME to maemo-launcher".
+
+ -- Guillem Jover <guillem.jover at nokia.com>  Thu, 10 Jul 2008 19:29:18 +0300
+
 maemo-launcher (0.31-2) unstable; urgency=low
 
   * Sources af-defines.sh at the beginning to avoid it unconditionally

Modified: projects/haf/trunk/maemo-launcher/debian/init.d
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/init.d	2008-12-19 12:59:49 UTC (rev 17015)
+++ projects/haf/trunk/maemo-launcher/debian/init.d	2008-12-19 13:09:13 UTC (rev 17016)
@@ -3,8 +3,6 @@
 # $Id$
 #
 
-set -e
-
 NAME=maemo-launcher
 DESC="Maemo Launcher"
 DAEMON=/usr/bin/$NAME
@@ -13,8 +11,27 @@
 DAEMON_BASE_OPTS="--daemon --booster gtk"
 PIDFILE=/tmp/$NAME.pid
 
+# When inside scratchbox we are not really root nor do we have 'user' user
+if [ -f /targets/links/scratchbox.config ]; then
+  DAEMON_OPTS="$DAEMON_BASE_OPTS"
+else
+  # FIXME: this is wrong wrong wrong, and should not be hardcoded, this script
+  #        belongs in the session level instead.
+  PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+  USER=user
+  HOME=/home/$USER
+  if [ `id -u` = 0 ]; then
+    CHUID="--chuid $USER"
+    # Make sure the launcher is not an OOM candidate
+    NICE="--nicelevel -1"
+  fi
+  DAEMON_OPTS="$DAEMON_BASE_OPTS --quiet"
+fi
+
 test -x $DAEMON || exit 0
 
+set -e
+
 # Those files set needed environment variables for the Maemo applications
 # FIXME: but this should not be needed either, and should be inherited from
 #        the session instead.
@@ -30,26 +47,6 @@
   exit 1
 fi
 
-# When inside scratchbox we are not really root nor do we have 'user' user
-if [ -f /targets/links/scratchbox.config ]; then
-  DAEMON_OPTS="$DAEMON_BASE_OPTS"
-else
-  # FIXME: this is wrong wrong wrong, and should not be hardcoded, this script
-  #        belongs in the session level instead.
-  PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-  export USER=user
-  export LOGNAME=$USER
-  PWENTRY=`getent passwd $USER`
-  export HOME=`echo $PWENTRY | cut -d: -f6`
-  export SHELL=`echo $PWENTRY | cut -d: -f7`
-  if [ `id -u` = 0 ]; then
-    CHUID="--chuid $USER"
-    # Make sure the launcher is not an OOM candidate
-    NICE="--nicelevel -1"
-  fi
-  DAEMON_OPTS="$DAEMON_BASE_OPTS --quiet"
-fi
-
 case "$1" in
   start)
     echo -n "Starting $DESC: $NAME"


More information about the maemo-commits mailing list