Dear tagattie! First of all thank you for the port! For the problem I want to report I already have a fix for: The powernds-recursor could not be restarted on two of my machines with `service pdns-recursor restart` and produced an error message ``` [...] Mar 07 00:56:53 Exception: Resolver binding to server socket on port 53 for *.*.*.*: Address already in use /usr/local/etc/rc.d/pdns-recursor: WARNING: failed to start pdns_recursor ``` and after reading the terminal output a little further I noticed another line saying: `pdns_recursor not running? (check /var/run/pdns-recursor/pdns_recursor.pid).` I found out, that there was no pid-file ever created in that location and was able to fix it by adding `socket-dir=/var/run/pdns-recursor` to the `/usr/local/etc/pdns/recursor.conf`. I now wonder if that should not be its default value ever since bug 244657
Hi Max, The error you got said 'Address already in use'. So something else was running on port 53 which caused startup to fail. Ofcourse the PID listen in the .pid file wasn't running, which caused the rc.d script to tell you it's not running. I've tested stopping the recursor, removing the /var/run/pdns-recursor directory, reinstalling the port (which creates the direcvtory again) and then starting it again. Everything works as expected. the socket-dir directive in my configuration is commented out, so it's using the default (which changed some versions back from /var/run to /var/run/pdns-recursor) IMO no fix is necessary since everything works as expected.
Hi Ralf! I have rechecked my configuration as well and can now further explain what happens: The `socket-dir` in the configuration file is also used to tell pdns-recursor where to store the PID file¹, while the `/usr/local/etc/rc.d/pdns-recursor` init script has this path hard-coded to `/var/run/pdns-recursor/${name}.pid`. The 'Address already in use' error is a consequence of that, because I used `service pdns-recursor restart` with a manually configured `socket-dir`. Because of that the init script was unable to kill the previous instance before it tried to start another. ¹ https://docs.powerdns.com/recursor/settings.html#socket-dir
Hi Max, Sorry for my late response. I was struggling to get the rc.d script to behave and fix your issue. With the update to 4.4.3 I also reworked that script so it should always write the pidfile to /var/run (no sub-directory) and since it uses /usr/sbin/daemon now, I chose to use the -r parameter so it will restart the recursor if it dies for any reason. Hope that helps with the issue you were having. Cheers, Ralf
Please close this PR. Already fixed in PR bug #254865
^Triage: OBE, see PR 256530.