Update postinst
authorSteven Luo <steven+maemo@steven676.net>
Sat, 28 Aug 2010 06:49:18 +0000 (23:49 -0700)
committerSteven Luo <steven+maemo@steven676.net>
Sat, 28 Aug 2010 12:14:44 +0000 (05:14 -0700)
We can now coexist with a running MicroB browser process, so don't try
to kill off browser in the postinst.  On the other hand, we now need
browser-switchboard running at all times in order for things to work
correctly (especially if there is a MicroB browser process running), so
start browser-switchboard as the user.  We assume the Maemo default
user, since we have no good way of checking this, and on a regular
device (e.g. not the SDK) it's always true.

debian/postinst

index 1eb18ce..0175a39 100644 (file)
@@ -20,13 +20,9 @@ set -e
 
 case "$1" in
     configure)
 
 case "$1" in
     configure)
-       # If there's a MicroB browser process in the background, try to kill
-       # it off, because it's taking com.nokia.osso_browser and preventing
-       # us from working
-       browser_pids=`pidof browser || true`
-       if [ ! -z "$browser_pids" ]; then
-               kill $browser_pids || true
-       fi
+       # Try to start browser-switchboard as the user
+       # XXX: we're assuming here that the user is named "user"
+       /bin/su - user -c "/etc/X11/Xsession.post/35browser-switchboard" || true
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)