From 7f02fb94fc26084463f36e5397565e40f599c1db Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 21 Aug 2014 16:35:30 +0200 Subject: [PATCH] MT#8741 remove init script tricks --- debian/ngcp-mediator.postinst | 54 ----------------------------------- debian/ngcp-mediator.postrm | 18 ------------ 2 files changed, 72 deletions(-) delete mode 100755 debian/ngcp-mediator.postinst delete mode 100755 debian/ngcp-mediator.postrm diff --git a/debian/ngcp-mediator.postinst b/debian/ngcp-mediator.postinst deleted file mode 100755 index 185290d..0000000 --- a/debian/ngcp-mediator.postinst +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -# postinst script for ngcp-mediator - -set -e - -restart_handler() { - if [ -x "/etc/init.d/mediator" ]; then - if [ -x "$(which invoke-rc.d 2>/dev/null)" ]; then - invoke-rc.d mediator restart || exit $? - else - /etc/init.d/mediator restart || exit $? - fi - fi -} - -initscript_handler() { - if [ -x "/etc/init.d/mediator" ]; then - update-rc.d mediator defaults >/dev/null - invoke-rc.d mediator 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 - initscript_handler - else # do not restart daemon on inactive node in pro systems - if ngcp-check_active ; then - echo "Active node detected, restarting mediator" - restart_handler - else - echo "Inactive node detected, ignoring request to restart mediator" - fi - fi -} - -case "$1" in - configure) - init_handler - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/debian/ngcp-mediator.postrm b/debian/ngcp-mediator.postrm deleted file mode 100755 index 54cbd4b..0000000 --- a/debian/ngcp-mediator.postrm +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# postrm script for ngcp-mediator - -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 mediator remove >/dev/null - fi -} - -if [ "$1" = "purge" ] ; then - removal_wrapper -fi - -exit 0