diff --git a/debian/ngcp-sems.postinst b/debian/ngcp-sems.postinst index 443ad147..73acc76d 100644 --- a/debian/ngcp-sems.postinst +++ b/debian/ngcp-sems.postinst @@ -5,9 +5,11 @@ set -e dpkg-maintscript-helper rm_conffile /etc/default/sems -- "$@" dpkg-maintscript-helper rm_conffile /etc/init.d/sems -- "$@" -# don't do anything when called with other argument than configure case "$1" in configure) + # add sems user + adduser --quiet --system --group --disabled-password --shell /bin/false \ + --gecos "SIP Express Media Server" --home /var/run/ngcp-sems sems || true ;; abort-upgrade|abort-remove|abort-deconfigure) exit 0 @@ -18,54 +20,6 @@ case "$1" in ;; esac -restart_handler() { - if [ -x "/etc/init.d/ngcp-sems" ]; then - if [ -x "$(which invoke-rc.d 2>/dev/null)" ]; then - invoke-rc.d ngcp-sems restart || exit $? - else - /etc/init.d/ngcp-sems restart || exit $? - fi - fi -} - -initscript_handler() { - if [ -x "/etc/init.d/ngcp-sems" ]; then - update-rc.d ngcp-sems defaults >/dev/null - invoke-rc.d ngcp-sems 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 ngcp-sems" - restart_handler - else - echo "Inactive node detected, ignoring request to restart ngcp-sems" - fi - fi -} - -# add sems user -adduser --quiet --system --group --disabled-password --shell /bin/false \ ---gecos "SIP Express Media Server" --home /var/run/ngcp-sems sems || true - -init_handler - -echo "" -echo "***" -echo "Configuration of ngcp-sems has finished." -echo "" -echo "To restart it when configuration has changed use '/etc/init.d/ngcp-sems restart'" -echo "" -echo "To change it's configuration use 'dpkg-reconfigure ngcp-sems'" -echo "***" -echo "" +#DEBHELPER# exit 0 diff --git a/debian/ngcp-sems.postrm b/debian/ngcp-sems.postrm deleted file mode 100644 index 29fbd00b..00000000 --- a/debian/ngcp-sems.postrm +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# postrm script for ngcp-sems - -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 ngcp-sems remove >/dev/null - fi -} - -if [ "$1" = "purge" ] ; then - removal_wrapper -fi - -exit 0