mirror of https://github.com/sipwise/rtpengine.git
This is supposed to fix the missing ngcp-mediaproxy-ng-daemon link in /etc/rc2.d on CE systems. While at it also try to handle restart/stop of service during upgrades and package removals in a sane way. Needs extensive testing though. From: Michael Prokop <mprokop@sipwise.com>git.mgm/mediaproxy-ng/2.0
parent
1b93bdb9b7
commit
3e792a689c
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# postrm script for ngcp-mediaproxy-ng-daemon
|
||||
|
||||
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-mediaproxy-ng-daemon remove >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$1" = "purge" ] ; then
|
||||
removal_wrapper
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# prerm script for ngcp-mediaproxy-ng-daemon
|
||||
|
||||
set -e
|
||||
|
||||
stop_handler() {
|
||||
if [ -x "/etc/init.d/ngcp-mediaproxy-ng-daemon" ]; then
|
||||
invoke-rc.d ngcp-mediaproxy-ng-daemon stop || exit $?
|
||||
fi
|
||||
}
|
||||
|
||||
stop_daemon() {
|
||||
# just stop the service on ce systems because
|
||||
# the pro system handle it as part of their monitoring/HA setup
|
||||
if ! [ -x "$(which ngcp-check_active 2>/dev/null)" ]; then
|
||||
stop_handler
|
||||
else
|
||||
case "$2" in
|
||||
upgrade)
|
||||
echo "Detected upgrade procedure, not stopping ngcp-mediaproxy-ng-daemon service."
|
||||
;;
|
||||
remove|purge)
|
||||
stop_handler
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$1" = "prerm" ] ; then
|
||||
stop_daemon
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Loading…
Reference in new issue