diff --git a/services/univention-bind/usr/lib/univention-server/server_password_change.d/univention-bind b/services/univention-bind/usr/lib/univention-server/server_password_change.d/univention-bind index 7de86c37f6..7d74985dfa 100755 --- a/services/univention-bind/usr/lib/univention-server/server_password_change.d/univention-bind +++ b/services/univention-bind/usr/lib/univention-server/server_password_change.d/univention-bind @@ -36,39 +36,10 @@ if [ -n "$bind_bindpw" -a "$bind_bindpw" != "/etc/machine.secret" ]; then exit 0 fi -bind_service () { - local action="$1" - - # start / stop bind9 only if the ldap backend is configured - if [ "$dns_backend" = "ldap" ]; then - if [ "$action" = "start" ]; then - # start bind9 only if it has been stopped by this script - if [ "$dns_bind9_stoppedbyserverpasswordchange" = "yes" ] ; then - echo "starting bind9 after server password change" | logger -t "server-password-change" - invoke-rc.d bind9 start >/dev/null - univention-config-registry unset dns/bind9/stoppedbyserverpasswordchange >/dev/null - fi - fi - if [ "$action" = "stop" ]; then - if invoke-rc.d bind9 status | grep -q "is running" ; then - univention-config-registry set dns/bind9/stoppedbyserverpasswordchange=yes >/dev/null - echo "stopping bind9 due to upcoming server password change" | logger -t "server-password-change" - invoke-rc.d bind9 stop >/dev/null - fi - fi - fi -} - -if [ "$1" = "prechange" ] ; then - bind_service stop -fi - -if [ "$1" = "nochange" ] ; then - bind_service start -fi - if [ "$1" = "postchange" ] ; then # update zone files sed -i "s|\!x-bindpw=\(.*\),x-tls|\!x-bindpw=$(cat /etc/machine.secret),x-tls|" /etc/bind/univention.conf.d/* - bind_service start + # Reload or restart LDAP-BIND (if running) + [ "$dns_backend" = "ldap" ] && + systemctl reload-or-try-restart fi