DAEMON=/usr/sbin/pdns_server
DAEMON_ARGS=""
CONTROL=/usr/bin/pdns_control
-PIDFILE=/var/run/$NAME.pid
+SOCKETDIR=/var/run/pdns
+PIDFILE=$SOCKETDIR/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
[ -x "$DAEMON" ] || exit 0
DAEMON_ARGS="$DAEMON_ARGS $SUFFIX"
NAME="$NAME-$suffix"
DESC="$DESC (config name $suffix)"
- PIDFILE="/var/run/$NAME-$suffix.pid"
+ PIDFILE="/var/run/pdns/$NAME-$suffix.pid"
fi
# Load lsb stuff for systemd redirection (if available).
if isrunning; then
return 1
fi
+ mkdir -p $SOCKETDIR
start-stop-daemon --start --quiet \
--pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS --daemon --guardian=yes \
DAEMON=/usr/sbin/pdns_server
DAEMON_ARGS=""
CONTROL=/usr/bin/pdns_control
-PIDFILE=/var/run/$NAME.pid
+SOCKETDIR=/var/run/pdns
+PIDFILE=$SOCKETDIR/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
[ -x "$DAEMON" ] || exit 0
DAEMON_ARGS="$DAEMON_ARGS $SUFFIX"
NAME="$NAME-$suffix"
DESC="$DESC (config name $suffix)"
- PIDFILE="/var/run/$NAME-$suffix.pid"
+ PIDFILE="/var/run/pdns/$NAME-$suffix.pid"
fi
# Load lsb stuff for systemd redirection (if available).
if isrunning; then
return 1
fi
+ mkdir -p $SOCKETDIR
start-stop-daemon --start --quiet \
--pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS --daemon --guardian=yes \
DAEMON=/usr/sbin/pdns_server
DAEMON_ARGS=""
CONTROL=/usr/bin/pdns_control
-PIDFILE=/var/run/$NAME.pid
+SOCKETDIR=/var/run/pdns
+PIDFILE=$SOCKETDIR/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
[ -x "$DAEMON" ] || exit 0
DAEMON_ARGS="$DAEMON_ARGS $SUFFIX"
NAME="$NAME-$suffix"
DESC="$DESC (config name $suffix)"
- PIDFILE="/var/run/$NAME-$suffix.pid"
+ PIDFILE="/var/run/pdns/$NAME-$suffix.pid"
fi
# Load lsb stuff for systemd redirection (if available).
if isrunning; then
return 1
fi
+ mkdir -p $SOCKETDIR
start-stop-daemon --start --quiet \
--pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS --daemon --guardian=yes \
DAEMON=/usr/sbin/pdns_server
DAEMON_ARGS=""
CONTROL=/usr/bin/pdns_control
-PIDFILE=/var/run/$NAME.pid
+SOCKETDIR=/var/run/pdns
+PIDFILE=$SOCKETDIR/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
[ -x "$DAEMON" ] || exit 0
DAEMON_ARGS="$DAEMON_ARGS $SUFFIX"
NAME="$NAME-$suffix"
DESC="$DESC (config name $suffix)"
- PIDFILE="/var/run/$NAME-$suffix.pid"
+ PIDFILE="/var/run/pdns/$NAME-$suffix.pid"
fi
# Load lsb stuff for systemd redirection (if available).
if isrunning; then
return 1
fi
+ mkdir -p $SOCKETDIR
start-stop-daemon --start --quiet \
--pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS --daemon --guardian=yes \
exec_prefix=/usr
BINARYPATH=/usr/bin
SBINARYPATH=/usr/sbin
-SOCKETPATH=/var/run
+SOCKETPATH=/var/run/pdns
[ -f "$SBINARYPATH/pdns_server" ] || exit 0
[ -r /etc/default/pdns ] && . /etc/default/pdns
+mkdir -p $SOCKETPATH
cd $SOCKETPATH
suffix=$(basename $0 | cut -d- -f2- -s)
if [ -n "$suffix" ]
{
::arg().set("config-dir","Location of configuration directory (pdns.conf)")=SYSCONFDIR;
::arg().set("config-name","Name of this virtual configuration - will rename the binary image")="";
- ::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 when unset and not chrooted" )="";
::arg().set("module-dir","Default directory for modules")=PKGLIBDIR;
::arg().set("chroot","If set, chroot to this directory for more security")="";
::arg().set("logging-facility","Log under a specific facility")="";
string socketname = ::arg()["socket-dir"];
if (::arg()["socket-dir"].empty()) {
if (::arg()["chroot"].empty())
- socketname = LOCALSTATEDIR;
+ socketname = std::string(LOCALSTATEDIR) + "/pdns";
else
socketname = ::arg()["chroot"];
} else if (!::arg()["socket-dir"].empty() && !::arg()["chroot"].empty()) {
string s_programname="pdns";
::arg().set("config-dir","Location of configuration directory (pdns.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 when unset and not chrooted" )="";
::arg().set("remote-address","Remote address to query");
::arg().set("remote-port","Remote port to query")="53000";
::arg().set("secret","Secret needed to connect to remote PowerDNS");
string socketname=::arg()["socket-dir"];
if (::arg()["socket-dir"].empty()) {
if (::arg()["chroot"].empty())
- socketname = LOCALSTATEDIR;
+ socketname = std::string(LOCALSTATEDIR) + "/pdns";
else
socketname = ::arg()["chroot"] + "/";
} else if (!::arg()["socket-dir"].empty() && !::arg()["chroot"].empty()) {
exec_prefix=@exec_prefix@
BINARYPATH=@bindir@
SBINARYPATH=@sbindir@
-SOCKETPATH=@socketdir@
+SOCKETPATH=@socketdir@/pdns
DAEMON_ARGS=""
[ -f "$SBINARYPATH/pdns_server" ] || exit 0
Restart=on-failure
RestartSec=1
StartLimitInterval=0
+RuntimeDirectory=pdns
# Sandboxing
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_CHOWN
string fname=::arg()["socket-dir"];
if (::arg()["socket-dir"].empty()) {
if (::arg()["chroot"].empty())
- fname = LOCALSTATEDIR;
+ fname = std::string(LOCALSTATEDIR) + "/pdns";
else
fname = ::arg()["chroot"] + "/";
} else if (!::arg()["socket-dir"].empty() && !::arg()["chroot"].empty()) {