From 656ea0afcce12efc9da5e85a80cb256a0d505f7a Mon Sep 17 00:00:00 2001 From: Jon Bonilla Date: Wed, 22 Aug 2012 09:41:30 +0000 Subject: [PATCH 1/5] Revert commit 9529 and re-add init stuff --- pkg/kamailio/deb/squeeze/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kamailio/deb/squeeze/rules b/pkg/kamailio/deb/squeeze/rules index 8c016b0c4..1678846a4 100755 --- a/pkg/kamailio/deb/squeeze/rules +++ b/pkg/kamailio/deb/squeeze/rules @@ -186,7 +186,7 @@ binary-common: # dh_installemacsen # dh_installpam # dh_installmime -# dh_installinit -- defaults 23 + dh_installinit -- defaults 23 dh_installcron dh_installman dh_installinfo From 1888251fe43084557517e27f5c929f044548cd95 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 22 Aug 2012 11:44:33 +0000 Subject: [PATCH 2/5] postinst: take care of services restarts in HA mode Needs review! Addressing https://bugtracker.sipwise.com/view.php?id=1225 From: Michael Prokop --- pkg/kamailio/deb/squeeze/kamailio.postinst | 57 +++++++++++++++------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/pkg/kamailio/deb/squeeze/kamailio.postinst b/pkg/kamailio/deb/squeeze/kamailio.postinst index fc7e4a819..e30606fac 100644 --- a/pkg/kamailio/deb/squeeze/kamailio.postinst +++ b/pkg/kamailio/deb/squeeze/kamailio.postinst @@ -8,30 +8,51 @@ HOMEDIR=/var/run/kamailio set -e -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package -# -# quoting from the policy: -# Any necessary prompting should almost always be confined to the -# post-installation script, and should be protected with a conditional -# so that unnecessary prompting doesn't happen if a package's -# installation fails and the `postinst' is called with `abort-upgrade', -# `abort-remove' or `abort-deconfigure'. +restart_handler() { + [ -n "$1" ] || return 1 + + if [ -x "/etc/init.d/$1" ]; then + if [ -x "$(which invoke-rc.d 2>/dev/null)" ]; then + invoke-rc.d "$1" restart || exit $? + else + /etc/init.d/"$1" restart || exit $? + fi + fi +} + +initscript_handler() { + [ -n "$1" ] || return 1 + + if [ -x "/etc/init.d/$1" ]; then + update-rc.d "$1" defaults >/dev/null + invoke-rc.d "$1" start || exit $? + fi +} + +init_handler() { + # just invoke init script wrappers on ce systems since + # they do not provide ngcp-check_active and we don't + # have to handle inactive nodes + if ! [ -x "$(which ngcp-check_active 2>/dev/null)" ]; then + restart_handler "$1" + initscript_handler "$1" + else # do not restart daemon on inactive node in pro systems + if ngcp-check_active ; then + echo "Active node detected, restarting $1" + restart_handler "$1" + else + echo "Inactive node detected, ignoring request to restart $1" + fi + fi +} case "$1" in configure) adduser --quiet --system --group --disabled-password \ --shell /bin/false --gecos "Kamailio" \ --home $HOMEDIR kamailio || true - + init_handler kamailio-lb + init_handler kamailio-proxy ;; abort-upgrade|abort-remove|abort-deconfigure) From fa85c2d2cb019cba30fb501c83165385dd87f1e4 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 22 Aug 2012 15:55:06 +0000 Subject: [PATCH 3/5] Provide postrm script From: Michael Prokop --- pkg/kamailio/deb/squeeze/kamailio.postrm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pkg/kamailio/deb/squeeze/kamailio.postrm diff --git a/pkg/kamailio/deb/squeeze/kamailio.postrm b/pkg/kamailio/deb/squeeze/kamailio.postrm new file mode 100644 index 000000000..a38ae43e3 --- /dev/null +++ b/pkg/kamailio/deb/squeeze/kamailio.postrm @@ -0,0 +1,19 @@ +#!/bin/sh +# postrm script for kamailio + +set -e + +removal_wrapper() { + # remove the init script only on ce systems, as the + # the pro system handle it inside the monitoring/HA setup + if ! [ -x "$(which ngcp-check_active 2>/dev/null)" ]; then + update-rc.d kamailio-lb remove >/dev/null + update-rc.d kamailio-proxy remove >/dev/null + fi +} + +if [ "$1" = "purge" ] ; then + removal_wrapper +fi + +exit 0 From c59306eb145e48cb5fc6178c1209b48cf1a80b2c Mon Sep 17 00:00:00 2001 From: Jon Bonilla Date: Thu, 23 Aug 2012 15:23:35 +0000 Subject: [PATCH 4/5] update changelog --- pkg/kamailio/deb/squeeze/changelog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/kamailio/deb/squeeze/changelog b/pkg/kamailio/deb/squeeze/changelog index 3b5ac7ebb..3b592dc09 100644 --- a/pkg/kamailio/deb/squeeze/changelog +++ b/pkg/kamailio/deb/squeeze/changelog @@ -1,3 +1,14 @@ +kamailio (3.3+ngcp2.6.1) unstable; urgency=low + + [ Michael Prokop ] + * Provide postrm script + * Provide postinst script, taking care of services restarts in HA mode + + [ jbonilla ] + * re-add init stuff + + -- Jon Bonilla Thu, 23 Aug 2012 17:23:00 +0200 + kamailio (3.3+ngcp2.6.0) unstable; urgency=low [ rfuchs ] From 2985b1b4d87ed54267f348e24bec25fe8b80ee8b Mon Sep 17 00:00:00 2001 From: Jon Bonilla Date: Thu, 23 Aug 2012 19:52:24 +0000 Subject: [PATCH 5/5] update changelog --- pkg/kamailio/deb/squeeze/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/kamailio/deb/squeeze/changelog b/pkg/kamailio/deb/squeeze/changelog index 3b592dc09..83e6e3a95 100644 --- a/pkg/kamailio/deb/squeeze/changelog +++ b/pkg/kamailio/deb/squeeze/changelog @@ -1,3 +1,9 @@ +kamailio (3.3+ngcp2.6.2) unstable; urgency=low + + * Fix bad tagging + + -- Jon Bonilla Thu, 23 Aug 2012 21:51:43 +0200 + kamailio (3.3+ngcp2.6.1) unstable; urgency=low [ Michael Prokop ]