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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Apr 16 01:36:01 EEST 2008
Author: guillem
Date: 2008-04-16 01:36:00 +0300 (Wed, 16 Apr 2008)
New Revision: 15428

Added:
   projects/haf/trunk/maemo-launcher/debian/maemo-launcher.postinst
   projects/haf/trunk/maemo-launcher/debian/maemo-launcher.prerm
Modified:
   projects/haf/trunk/maemo-launcher/debian/changelog
   projects/haf/trunk/maemo-launcher/debian/init.d
   projects/haf/trunk/maemo-launcher/debian/rules
Log:
Support upgrading the launcher via in-memory hot-swap

During reload the state is preserved, so that the invoked instances
can keep running. (Fixes: NB#82624)


Modified: projects/haf/trunk/maemo-launcher/debian/changelog
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/changelog	2008-04-15 22:35:58 UTC (rev 15427)
+++ projects/haf/trunk/maemo-launcher/debian/changelog	2008-04-15 22:36:00 UTC (rev 15428)
@@ -5,6 +5,8 @@
     - Use compile options determined from configure to build the client.
     - Use exit(3) instead of _exit(2) so that things like atexit(3) work.
       (Fixes: NB#80273)
+    - Support upgrading the launcher via in-memory hot-swap while preserving
+      the state. (Fixes: NB#82624)
   * Update copyright year in debian/copyright.
 
  -- Guillem Jover <guillem.jover at nokia.com>  Tue, 04 Dec 2007 20:03:29 +0200

Modified: projects/haf/trunk/maemo-launcher/debian/init.d
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/init.d	2008-04-15 22:35:58 UTC (rev 15427)
+++ projects/haf/trunk/maemo-launcher/debian/init.d	2008-04-15 22:36:00 UTC (rev 15428)
@@ -53,11 +53,17 @@
       || echo -n " not running"
     echo "."
     ;;
-  restart|force-reload)
+  restart)
     $0 stop
     sleep 1
     $0 start
     ;;
+  reload|force-reload)
+    echo -n "Reloading $DESC: $NAME"
+    start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE \
+      --exec $DAEMON || echo -n " not running"
+    echo "."
+    ;;
   *)
     N=/etc/init.d/$NAME
     echo "Usage: $N {start|stop|restart|force-reload}" >&2

Added: projects/haf/trunk/maemo-launcher/debian/maemo-launcher.postinst
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/maemo-launcher.postinst	2008-04-15 22:35:58 UTC (rev 15427)
+++ projects/haf/trunk/maemo-launcher/debian/maemo-launcher.postinst	2008-04-15 22:36:00 UTC (rev 15428)
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+# Reload the launcher binary from disk while preserving the current state
+# on upgrade (except when installing or upgrading from an old version).
+if [ "$1" = configure ] && [ -x "/etc/init.d/maemo-launcher" ]; then
+	if dpkg --compare-versions "$2" lt-nl 0.27-1; then
+		action=start
+	else
+		action=reload
+	fi
+
+	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+		invoke-rc.d maemo-launcher $action || exit $?
+	else
+		/etc/init.d/maemo-launcher $action || exit $?
+	fi
+fi
+
+#DEBHELPER#
+
+exit 0
+

Added: projects/haf/trunk/maemo-launcher/debian/maemo-launcher.prerm
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/maemo-launcher.prerm	2008-04-15 22:35:58 UTC (rev 15427)
+++ projects/haf/trunk/maemo-launcher/debian/maemo-launcher.prerm	2008-04-15 22:36:00 UTC (rev 15428)
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+if [ -x "/etc/init.d/maemo-launcher" ] && [ "$1" = remove ]; then
+	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+		invoke-rc.d maemo-launcher stop || exit $?
+	else
+		/etc/init.d/maemo-launcher stop || exit $?
+	fi
+fi
+
+#DEBHELPER#
+
+exit 0
+

Modified: projects/haf/trunk/maemo-launcher/debian/rules
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/rules	2008-04-15 22:35:58 UTC (rev 15427)
+++ projects/haf/trunk/maemo-launcher/debian/rules	2008-04-15 22:36:00 UTC (rev 15428)
@@ -88,7 +88,7 @@
 	dh_installexamples -a
 	dh_install -a --sourcedir=$(CURDIR)/debian/tmp
 #	dh_installlogrotate
-	dh_installinit -a -- start 45 2 3 4 . stop 45 0 1 5 6 .
+	dh_installinit -a --no-start -- start 45 2 3 4 . stop 45 0 1 5 6 .
 	dh_installman -a
 	dh_link -a
 	dh_strip --dbg-package=maemo-launcher


More information about the maemo-commits mailing list