# or fall back to the default /var/run if not specified there.
PIDDIR=$(awk -F= '/^socket-dir=/ {print $2}' /etc/powerdns/recursor.conf)
if [ -z "$PIDDIR" ]; then PIDDIR=/var/run; fi
+mkdir -p "$PIDDIR"
PIDFILE=$PIDDIR/$NAME.pid
# Gracefully exit if the package has been removed.