msg_Already_Running Pdns
exit 1
fi
- ;;
+ ;;
stop)
- # Stop daemons.
- # show "Stopping %s service" pdns
+ # Stop daemons.
+ # show "Stopping %s service" pdns
if [ -f /var/lock/subsys/pdns ]; then
- msg_stopping Pdns
- killproc pdnsd
+
+# 1. killproc causes pdnsd not to save cache file on exit.
+# The only signals not doing this are 4, 6, 8 and 11.
+# These signals terminate this script anyway.
+# 2. killproc tries to kill all found processes. In this
+# case they are connected and die together, so doing
+# this will print errors on screen.
+
+# msg_stopping Pdns
+# killproc pdnsd
+
+ echo "Stopping Pdns service"
+
rm -f /var/lock/subsys/pdns >/dev/null 2>&1
+
+ killall -FPE pdnsd
+
else
msg_Not_Running Pdns
exit 1
fi
- ;;
+ ;;
restart)
- $0 stop
- $0 start
- ;;
+ echo "Due to a pdnsd bug you must start it manually."
+ $0 stop
+ ;;
reload)
if [ -f /var/lock/subsys/pdns ]; then
msg_show Pdns
fi
;;
force-reload)
- # if program allows reloading without stopping
+ # if program allows reloading without stopping
$0 reload
exit $?
# or if it doesn't
- $0 stop && $0 start
+ $0 restart
exit $?
;;
status)
status pdnsd
exit $?
- ;;
+ ;;
*)
- # show "Usage: %s {start|stop|status|restart|reload|force-reload}" $0
+ # show "Usage: %s {start|stop|status|restart|reload|force-reload}" $0
msg_Usage "$0 {start|stop|status|restart|reload|force-reload}"
- exit 1
+ exit 1
esac
exit $RETVAL