diff --git a/deployment.sh b/deployment.sh index 7292250..e34ffe4 100755 --- a/deployment.sh +++ b/deployment.sh @@ -1556,37 +1556,21 @@ EOT ;; esac - # make sure all services are stopped - for service in \ - apache2 \ - asterisk \ - collectd \ - dnsmasq \ - exim4 \ - irqbalance \ - kamailio-lb \ - kamailio-proxy \ - mediator \ - monit \ - mysql \ - nfs-kernel-server \ - ngcp-rate-o-mat \ - ngcp-rtpengine-daemon \ - ngcp-sems \ - ntp \ - rsyslog \ - sems ; \ - do - if [ -f $TARGET/etc/init.d/$service ] ; then - chroot $TARGET /etc/init.d/$service stop || true + NGCP_SERVICES_FILE="${TAGRET}/usr/share/ngcp-system-tools/ngcp.inc" + if ! [ -r "$NGCP_SERVICES_FILE" ]; then + echo "Error: File $NGCP_SERVICES_FILE not found. Exiting." >&2 + exit 1 + fi + + # make sure services are stopped + . "$NGCP_SERVICES_FILE" + for service in ${HA_NGCP_SERVICES} ${NGCP_SERVICES} ${NON_NGCP_SERVICES} ; do + if [ -f "${TARGET}/etc/init.d/$service" ] ; then + echo "Stopping $service ..." + grml-chroot $TARGET /etc/init.d/$service stop || true fi done - if [ -f $TARGET/etc/init.d/prosody ] ; then - # prosody's init script requires mounted /proc - grml-chroot $TARGET /etc/init.d/prosody stop || true - fi - # nuke files for i in $(find "$TARGET/var/log" -type f -size +0 -not -name \*.ini 2>/dev/null); do :> "$i"