[maemo-commits] [maemo-commits] r17019 - projects/haf/trunk/maemo-launcher/debian
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Fri Dec 19 15:09:23 EET 2008
- Previous message: [maemo-commits] r17018 - projects/haf/trunk/maemo-launcher/debian
- Next message: [maemo-commits] r17020 - projects/haf/trunk/maemo-launcher/debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: guillem Date: 2008-12-19 15:09:22 +0200 (Fri, 19 Dec 2008) New Revision: 17019 Modified: projects/haf/trunk/maemo-launcher/debian/changelog projects/haf/trunk/maemo-launcher/debian/init.d Log: Export USER, LOGNAME, SHELL and HOME to maemo-launcher again But this time do it before and after sourcing af-defines.sh as it likes to make a mess and stomp on our variables. (Fixes: MM#1131) Modified: projects/haf/trunk/maemo-launcher/debian/changelog =================================================================== --- projects/haf/trunk/maemo-launcher/debian/changelog 2008-12-19 13:09:19 UTC (rev 17018) +++ projects/haf/trunk/maemo-launcher/debian/changelog 2008-12-19 13:09:22 UTC (rev 17019) @@ -1,3 +1,11 @@ +maemo-launcher (0.31-4) UNRELEASED; urgency=low + + * Export USER, LOGNAME, SHELL and HOME to maemo-launcher again, + but this time do it before and after sourcing af-defines.sh as it + likes to make a mess and stomp on our variables. (Fixes: MM#1131) + + -- Guillem Jover <guillem.jover at nokia.com> Thu, 09 Oct 2008 22:00:26 +0300 + maemo-launcher (0.31-3) unstable; urgency=low * Revert "Export USER, LOGNAME, SHELL and HOME to maemo-launcher". Modified: projects/haf/trunk/maemo-launcher/debian/init.d =================================================================== --- projects/haf/trunk/maemo-launcher/debian/init.d 2008-12-19 13:09:19 UTC (rev 17018) +++ projects/haf/trunk/maemo-launcher/debian/init.d 2008-12-19 13:09:22 UTC (rev 17019) @@ -3,6 +3,8 @@ # $Id$ # +set -e + NAME=maemo-launcher DESC="Maemo Launcher" DAEMON=/usr/bin/$NAME @@ -11,34 +13,35 @@ 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 +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 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. +set_login_vars() +{ + export USER=$1 + export LOGNAME=$USER + PWENTRY=`getent passwd $USER` + export HOME=`echo $PWENTRY | cut -d: -f6` + export SHELL=`echo $PWENTRY | cut -d: -f7` +} + # OSSO AF Init definitions DEFSDIR=/etc/osso-af-init/ +# When inside scratchbox we are not really root nor do we have 'user' user +if [ -f /targets/links/scratchbox.config ]; then + set_login_vars `id -u -n` +else + # FIXME: this is wrong wrong wrong, and should not be hardcoded, this script + # belongs in the session level instead. + set_login_vars user +fi + if [ -e $DEFSDIR/af-defines.sh ] then . $DEFSDIR/af-defines.sh @@ -47,6 +50,21 @@ exit 1 fi +# XXX: Reset the login variables, as af-defines.sh makes a mess and stomps +# on some of the variables we have already initialized! +if [ -f /targets/links/scratchbox.config ]; then + set_login_vars `id -u -n` + DAEMON_OPTS="$DAEMON_BASE_OPTS" +else + set_login_vars 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 + case "$1" in start) echo -n "Starting $DESC: $NAME"
- Previous message: [maemo-commits] r17018 - projects/haf/trunk/maemo-launcher/debian
- Next message: [maemo-commits] r17020 - projects/haf/trunk/maemo-launcher/debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]