This moves the default of the socket-dir to /var/run/pdns-recursor.
# Derive the socket-dir setting from /etc/powerdns/recursor.conf
# 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
+if [ -z "$PIDDIR" ]; then PIDDIR=/var/run/pdns-recursor; mkdir -p $PIDDIR; fi
PIDFILE=$PIDDIR/$NAME.pid
# Gracefully exit if the package has been removed.
# Derive the socket-dir setting from /etc/powerdns/recursor.conf
# 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
+if [ -z "$PIDDIR" ]; then PIDDIR=/var/run/pdns-recursor; mkdir -p $PIDDIR; fi
PIDFILE=$PIDDIR/$NAME.pid
# Gracefully exit if the package has been removed.
# Derive the socket-dir setting from /etc/powerdns/recursor.conf
# 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
+if [ -z "$PIDDIR" ]; then PIDDIR=/var/run/pdns-recursor; mkdir -p $PIDDIR; fi
PIDFILE=$PIDDIR/$NAME.pid
# Gracefully exit if the package has been removed.
# Derive the socket-dir setting from /etc/powerdns/recursor.conf
# 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
+if [ -z "$PIDDIR" ]; then PIDDIR=/var/run/pdns-recursor; mkdir -p $PIDDIR; fi
PIDFILE=$PIDDIR/$NAME.pid
# Gracefully exit if the package has been removed.
RETVAL=0
PIDDIR=$(awk -F= '/^socket-dir=/ {print $2}' /etc/pdns-recursor/recursor.conf)
-if [ -z "$PIDDIR" ]; then PIDDIR=/var/run; fi
-mkdir -p "$PIDDIR"
+if [ -z "$PIDDIR" ]; then PIDDIR=/var/run; mkdir -p $PIDDIR; fi
start() {
echo -n $"Starting pdns-recursor: "
::arg().set("socket-group","Group of socket")="";
::arg().set("socket-mode", "Permissions for socket")="";
- ::arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+" when unset and not chrooted" )="";
+ ::arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+"/pdns-recursor when unset and not chrooted" )="";
::arg().set("delegation-only","Which domains we only accept delegations from")="";
::arg().set("query-local-address","Source IP address for sending queries")="0.0.0.0";
::arg().set("query-local-address6","Source IPv6 address for sending queries. IF UNSET, IPv6 WILL NOT BE USED FOR OUTGOING QUERIES")="";
if (::arg()["socket-dir"].empty()) {
if (::arg()["chroot"].empty())
- ::arg().set("socket-dir") = LOCALSTATEDIR;
+ ::arg().set("socket-dir") = std::string(LOCALSTATEDIR) + "/pdns-recursor";
else
::arg().set("socket-dir") = "/";
}
{
arg().set("config-dir","Location of configuration directory (recursor.conf)")=SYSCONFDIR;
- arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+" when unset and not chrooted" )="";
+ arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+"/pdns-recursor when unset and not chrooted" )="";
arg().set("chroot","switch to chroot jail")="";
arg().set("process","When controlling multiple recursors, the target process number")="";
arg().set("timeout", "Number of seconds to wait for the recursor to respond")="5";
if (::arg()["socket-dir"].empty()) {
if (::arg()["chroot"].empty())
- ::arg().set("socket-dir") = LOCALSTATEDIR;
+ ::arg().set("socket-dir") = std::string(LOCALSTATEDIR) + "/pdns-recursor";
else
::arg().set("socket-dir") = ::arg()["chroot"] + "/";
} else if (!::arg()["chroot"].empty()) {
Type=notify
Restart=on-failure
StartLimitInterval=0
+RuntimeDirectory=pdns-recursor
# Tuning
LimitNOFILE=16384