修复3个问题: 1) setup-bind.sh确保服务启动 2) DNSSEC配置验证options块包裹 3) 添加IPv6开关功能

This commit is contained in:
Your Name
2026-08-07 11:31:14 +08:00
parent e20e235a1e
commit 948d4cff9a
3 changed files with 71 additions and 18 deletions
+18 -12
View File
@@ -145,21 +145,27 @@ ensure_include_in_named_conf() {
}
restart_named() {
log "Step 5: restart named so include takes effect"
if ! systemctl is-active --quiet "$SERVICE_NAME"; then
warn " $SERVICE_NAME not running; skipping restart"
log "Step 5: start/enable named service"
# Always enable and start/restart the service
if [[ $DRY_RUN -eq 1 ]]; then
printf ' [DRY-RUN] systemctl enable named\n'
printf ' [DRY-RUN] systemctl restart named (or start if not running)\n'
printf ' [DRY-RUN] sleep 1\n'
printf ' [DRY-RUN] systemctl is-active --quiet named && echo "named is active"\n'
return
fi
if [[ $DRY_RUN -eq 1 ]]; then
printf ' [DRY-RUN] systemctl restart %s\n' "$SERVICE_NAME"
systemctl enable named 2>/dev/null || true
if systemctl is-active --quiet named; then
systemctl restart named
else
run systemctl restart "$SERVICE_NAME"
sleep 1
if systemctl is-active --quiet "$SERVICE_NAME"; then
log " $SERVICE_NAME is active"
else
err " $SERVICE_NAME failed to start; check 'journalctl -xe -u $SERVICE_NAME'"
fi
systemctl start named
fi
sleep 1
if systemctl is-active --quiet named; then
log " named is active and running"
else
err " named failed to start; check 'journalctl -xe -u named'"
exit 1
fi
}