From 6fd2698ff9fa85f3f827fec62c13583c7ae7533a Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 21 Aug 2014 16:31:47 +0200 Subject: [PATCH] MT#8741 remove init links tricks --- debian/ngcp-kamailio.postinst | 42 ----------------------------------- debian/ngcp-kamailio.postrm | 21 ------------------ 2 files changed, 63 deletions(-) delete mode 100644 debian/ngcp-kamailio.postrm diff --git a/debian/ngcp-kamailio.postinst b/debian/ngcp-kamailio.postinst index ec1067e51..5d8c715c5 100644 --- a/debian/ngcp-kamailio.postinst +++ b/debian/ngcp-kamailio.postinst @@ -5,53 +5,11 @@ set -e HOMEDIR=/var/run/kamailio -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 - if ! update-rc.d "$1" defaults >/dev/null ; then - echo "Warning: update-rc.d could not be executed, might be caused by mysql not available yet." - fi - 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) diff --git a/debian/ngcp-kamailio.postrm b/debian/ngcp-kamailio.postrm deleted file mode 100644 index c5c647715..000000000 --- a/debian/ngcp-kamailio.postrm +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# postrm script for kamailio - -set -e - -removal_wrapper() { - # remove the init script only on ce systems, as - # the pro system handles 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 - -#DEBHELPER#