<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
<div><div><span class="ydp90202e0bs1">From what I can see unbound init script is up-to-date. Do I need to add override for the pidfile in unbound config? Even if I do that and it works, I will still need to update the unbound init script as well so the easiest file to me to update the init script to explicitly remove the pid file after unbound is stopped. I wonder how other people running unbound in a chroot setup on ubuntu/debian is dealing with the issue.</span></div><div><span class="ydp90202e0bs1"><br></span></div><div><span class="ydp90202e0bs1">root@DFW01-CPS02:/etc/unbound/unbound.conf.d# cat test.conf</span></div>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">server:</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>chroot: "/var/lib/unbound"</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>verbosity: 9</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>do-not-query-localhost: no</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>statistics-cumulative: yes</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>extended-statistics: yes</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>interface: 127.0.0.1</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">python:</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">remote-control:</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>control-enable: yes</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">root@DFW01-CPS02:/etc/unbound/unbound.conf.d#<span class="ydp90202e0bApple-converted-space"> </span></span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">root@DFW01-CPS02:/etc/unbound/unbound.conf.d# cat /etc/init.d/unbound<span class="ydp90202e0bApple-converted-space"> </span></span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">#!/bin/sh</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">### BEGIN INIT INFO</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"># Provides:<span class="ydp90202e0bApple-converted-space"> </span>unbound</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"># Required-Start:<span class="ydp90202e0bApple-converted-space"> </span>$network $remote_fs $syslog</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"># Required-Stop: <span class="ydp90202e0bApple-converted-space"> </span>$network $remote_fs $syslog</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"># Default-Start: <span class="ydp90202e0bApple-converted-space"> </span>2 3 4 5</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"># Default-Stop:<span class="ydp90202e0bApple-converted-space"> </span>0 1 6</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">### END INIT INFO</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">NAME="unbound"</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">DESC="DNS server"</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">DAEMON="/usr/sbin/unbound"</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">PIDFILE="/run/unbound.pid"</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">HELPER="/usr/lib/unbound/package-helper"</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">test -x $DAEMON || exit 0</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">. /lib/lsb/init-functions</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"># Override this variable by editing or creating /etc/default/unbound.</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">DAEMON_OPTS=""</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">if [ -f /etc/default/unbound ]; then</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>. /etc/default/unbound</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">fi</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">case "$1" in</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>start)</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_daemon_msg "Starting $DESC" "$NAME"</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>$HELPER chroot_setup</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>$HELPER root_trust_anchor_update 2>&1 | logger -p daemon.info -t unbound-anchor</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --name $NAME --startas $DAEMON -- $DAEMON_OPTS; then</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>$HELPER resolvconf_start</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_end_msg 0</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>else</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_end_msg 1</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>fi</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>;;</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>stop)</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_daemon_msg "Stopping $DESC" "$NAME"</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name $NAME; then</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>$HELPER resolvconf_stop</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_end_msg 0</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>else</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_end_msg 1</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>fi</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>;;</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>restart|force-reload)</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_daemon_msg "Restarting $DESC" "$NAME"</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --retry 5</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>$HELPER resolvconf_stop</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --name $NAME --startas $DAEMON -- $DAEMON_OPTS; then</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>$HELPER chroot_setup</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>$HELPER resolvconf_start</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_end_msg 0</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>else</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_end_msg 1</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>fi</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>;;</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>reload)</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_daemon_msg "Reloading $DESC" "$NAME"</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>if start-stop-daemon --stop --pidfile $PIDFILE --signal 1; then</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>$HELPER chroot_setup</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_end_msg 0</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>else</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>log_end_msg 1</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>fi</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>;;</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>status)</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>;;</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>*)</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>N=/etc/init.d/$NAME</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>echo "Usage: $N {start|stop|restart|status|reload|force-reload}" >&2</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>exit 1</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1"><span class="ydp90202e0bApple-converted-space"> </span>;;</span></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">esac</span></p>
<p class="ydp90202e0bp2"><span class="ydp90202e0bs1"></span><br></p>
<p class="ydp90202e0bp1"><span class="ydp90202e0bs1">exit 0</span></p><br></div><div><br></div><div><br></div>
<div id="ydp16935d1eyahoo_quoted_1139940772" class="ydp16935d1eyahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Wednesday, March 7, 2018, 4:33:37 AM PST, Robert Edmonds via Unbound-users <unbound-users@unbound.net> wrote:
</div>
<div><br></div>
<div><br></div>
<div>Shawn Zhou via Unbound-users wrote:<div class="ydp16935d1eyqt6116387897" id="ydp16935d1eyqtfd47971"><br clear="none">> I am running unbound 1.5.8 on ubuntu xenial. unbound doesn't run remove the pid file after it's stopped.</div><br clear="none"><br clear="none">I believe the unbound packaging on Ubuntu xenial is old enough that it<br clear="none">still uses the sysv generator to create the service unit. You will<br clear="none">probably want to add this fix to your unbound init script, which I don't<br clear="none">think was ever backported to xenial (it was originally added in 1.5.9-1):<br clear="none"><br clear="none"><a shape="rect" href="https://salsa.debian.org/dns-team/unbound/commit/1c139abaa0fe58f8d97b64c96da6c3332b1b9e49" rel="nofollow" target="_blank">https://salsa.debian.org/dns-team/unbound/commit/1c139abaa0fe58f8d97b64c96da6c3332b1b9e49</a><br clear="none"><br clear="none">-- <br clear="none">Robert Edmonds<br clear="none"><a shape="rect" href="mailto:edmonds@debian.org" rel="nofollow" target="_blank">edmonds@debian.org</a><div class="ydp16935d1eyqt6116387897" id="ydp16935d1eyqtfd26214"><br clear="none"></div></div>
</div>
</div></div></body></html>