From aae1dc6f452b047fb5d7ad8826d9827dfade6ab1 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 17 Jun 2025 10:24:52 +0200 Subject: [PATCH] rec and auth: implement stop command as alias for quit(-nicely) Fixes #15674 Signed-off-by: Otto Moerbeek --- docs/manpages/pdns_control.1.rst | 4 ++-- pdns/dynloader.cc | 2 +- pdns/recursordist/docs/manpages/pdns_recursor.1.rst | 2 +- pdns/recursordist/rec_channel_rec.cc | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/manpages/pdns_control.1.rst b/docs/manpages/pdns_control.1.rst index 17ce3a0b58..0ffc838b51 100644 --- a/docs/manpages/pdns_control.1.rst +++ b/docs/manpages/pdns_control.1.rst @@ -120,8 +120,8 @@ qtypes Get a count of queries per qtype on standard output. -quit -^^^^ +quit or stop +^^^^^^^^^^^^ Tell a running pdns\_server to quit. diff --git a/pdns/dynloader.cc b/pdns/dynloader.cc index 64619d473b..9f46e4c82a 100644 --- a/pdns/dynloader.cc +++ b/pdns/dynloader.cc @@ -142,7 +142,7 @@ int main(int argc, char **argv) message="SHOW *"; command="show"; } - else if(command=="quit" || command=="QUIT") { + else if(command=="quit" || command=="QUIT" || command == "stop" || command == "STOP") { message="QUIT"; } else if(command=="status" || command=="STATUS") { diff --git a/pdns/recursordist/docs/manpages/pdns_recursor.1.rst b/pdns/recursordist/docs/manpages/pdns_recursor.1.rst index d3665f695b..6212ba76a5 100644 --- a/pdns/recursordist/docs/manpages/pdns_recursor.1.rst +++ b/pdns/recursordist/docs/manpages/pdns_recursor.1.rst @@ -25,7 +25,7 @@ as in the background, execute:: To stop the recursor by hand, run:: - # rec_control quit + # rec_control quit-nicely However, the recommended way of starting and stopping the recursor is to use :manpage:`systemctl(1)` or the init.d script. diff --git a/pdns/recursordist/rec_channel_rec.cc b/pdns/recursordist/rec_channel_rec.cc index 293ae1dbca..78275caa92 100644 --- a/pdns/recursordist/rec_channel_rec.cc +++ b/pdns/recursordist/rec_channel_rec.cc @@ -1881,7 +1881,7 @@ static RecursorControlChannel::Answer help() "list-dnssec-algos list supported DNSSEC algorithms\n" "ping check that all threads are alive\n" "quit stop the recursor daemon\n" - "quit-nicely stop the recursor daemon nicely\n" + "quit-nicely or stop stop the recursor daemon nicely\n" "reload-acls reload ACLS\n" "reload-lua-script [filename] (re)load Lua script\n" "reload-yaml Reload runtime settable parts of YAML settings\n" @@ -2062,7 +2062,7 @@ RecursorControlChannel::Answer RecursorControlParser::getAnswer(int socket, cons if (cmd == "version") { return {0, getPDNSVersion() + "\n"}; } - if (cmd == "quit-nicely") { + if (cmd == "quit-nicely" || cmd == "stop") { *command = &doExitNicely; return {0, "bye nicely\n"}; } -- 2.47.2