ON FREEBSD: # ps auxw | grep nsd bind 28297 0.0 0.3 48692 26564 - Ss 12:50PM 0:00.09 /usr/local/sbin/nsd -c /usr/local/etc/nsd/nsd.conf bind 28298 0.0 0.4 55504 37104 - S 12:50PM 0:00.09 /usr/local/sbin/nsd -c /usr/local/etc/nsd/nsd.conf bind 28299 0.0 0.4 55504 37220 - S 12:50PM 0:00.03 /usr/local/sbin/nsd -c /usr/local/etc/nsd/nsd.conf # nsd-control status version: 4.1.7 verbosity: 3 ratelimit: 200 # nsd-control stop ok # ps auxw | grep nsd <nothing> # nsd-control status error: connect (127.0.0.1 at 8952): Connection refused nsd is stopped # service nsd start Starting nsd. # nsd-control status version: 4.1.7 verbosity: 3 ratelimit: 200 ps auxw | grep nsd bind 28721 0.0 0.3 48692 26560 - Ss 1:04PM 0:00.09 /usr/local/sbin/nsd -c /usr/local/etc/nsd/nsd.conf bind 28722 0.0 0.4 55504 37108 - S 1:04PM 0:00.09 /usr/local/sbin/nsd -c /usr/local/etc/nsd/nsd.conf bind 28723 0.0 0.4 55504 37224 - S 1:04PM 0:00.00 /usr/local/sbin/nsd -c /usr/local/etc/nsd/nsd.conf ON DEBIAN: # nsd-control status version: 4.1.26 verbosity: 2 ratelimit: 200 # ps auxw | grep nsd nsd 3790 0.0 0.2 112192 89920 ? Ss 13:02 0:00 /usr/sbin/nsd -d nsd 3791 0.0 0.1 43872 34900 ? S 13:02 0:00 /usr/sbin/nsd -d nsd 3792 0.0 0.0 44216 2848 ? S 13:02 0:00 /usr/sbin/nsd -d # nsd-control stop ok # nsd-control status version: 4.1.26 verbosity: 2 ratelimit: 200 # service nsd stop # service nsd status nsd.service - Name Server Daemon Loaded: loaded (/lib/systemd/system/nsd.service; enabled; vendor preset: enabled) Active: inactive (dead) since Fri 2021-02-12 13:08:20 EST; 3s ago Docs: man:nsd(8) Process: 3790 ExecStart=/usr/sbin/nsd -d (code=exited, status=0/SUCCESS) Main PID: 3790 (code=exited, status=0/SUCCESS) Feb 12 13:02:11 h6lix nsd[3790]: [2021-02-12 13:02:11.922] nsd[3790]: info: new control connection from 127.0.0.1 Feb 12 13:02:11 h6lix nsd[3790]: [2021-02-12 13:02:11.941] nsd[3790]: info: control cmd: status Feb 12 13:08:20 h6lix nsd[3790]: [2021-02-12 13:08:20.373] nsd[3791]: warning: signal received, shutting down... Feb 12 13:08:20 h6lix nsd[3790]: [2021-02-12 13:08:20.373] nsd[3791]: warning: failed to unlink pidfile /run/nsd/nsd.pid: Permission denied Feb 12 13:08:20 h6lix systemd[1]: Stopping Name Server Daemon... Feb 12 13:08:20 h6lix systemd[1]: nsd.service: Succeeded. Feb 12 13:08:20 h6lix systemd[1]: Stopped Name Server Daemon. # ps auxw | grep nsd <nothing> # service nsd start # service nsd status nsd.service - Name Server Daemon Loaded: loaded (/lib/systemd/system/nsd.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2021-02-12 13:10:20 EST; 5s ago Docs: man:nsd(8) Main PID: 3976 (nsd) Tasks: 3 (limit: 4915) Memory: 114.7M CGroup: /system.slice/nsd.service 3976 /usr/sbin/nsd -d 3977 /usr/sbin/nsd -d 3978 /usr/sbin/nsd -d Feb 12 13:10:20 h6lix nsd[3976]: [2021-02-12 13:10:20.041] nsd[3976]: notice: nsd starting (NSD 4.1.26) Feb 12 13:10:20 h6lix nsd[3976]: [2021-02-12 13:10:20.043] nsd[3976]: info: setup SSL certificates Feb 12 13:10:20 h6lix nsd[3976]: [2021-02-12 13:10:20.087] nsd[3977]: notice: nsd started (NSD 4.1.26), pid 3976 Feb 12 13:10:20 h6lix systemd[1]: Started Name Server Daemon. # nsd-control status version: 4.1.26 verbosity: 2 ratelimit: 200 On Debian I do notice that issuing an 'nsd-control stop' does generate a new PID in /var/run/nsd/nsd.pid. The only way I can actually stop the NSD daemon seems to be with the service or systemctl commands. Is it just in Debian's nature of how it handles services differently, that it will always respawn the process(es)/daemon automatically? Thanks, FONG
On 12/02/2021 19:14, Fong via nsd-users wrote: Hi Fong, [snip]> On Debian I do notice that issuing an 'nsd-control stop' does generate a > new PID in /var/run/nsd/nsd.pid. > > The only way I can actually stop the NSD daemon seems to be with the > service or systemctl commands.That is the only way you should be stopping and starting NSD.> Is it just in Debian's nature of how it handles services differently, > that it will always respawn the process(es)/daemon automatically?Debian (and most Linux systems nowadays) run all their processes under systemd, which supervises them, and ensures that they are restarted in case they die. If you run "nsd-control stop" then NSD exits without the knowledge of systemd, and it thinks the daemon crashed, so it restarts it. Anand