From 6121a2ee7583b76bb0afde98524b8b33060db483 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Tue, 9 Sep 2014 19:27:34 +0200 Subject: [PATCH] implement & document rec_control version, closes #1706 --- pdns/docs/pdns.xml | 9 +++++++++ pdns/docs/rec_control.1.txt | 9 ++++++--- pdns/rec_channel_rec.cc | 6 ++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/pdns/docs/pdns.xml b/pdns/docs/pdns.xml index 5973330f6..9374b009e 100644 --- a/pdns/docs/pdns.xml +++ b/pdns/docs/pdns.xml @@ -15922,6 +15922,15 @@ sql> insert into domainmetadata (domain_id, kind, content) values (6, 'TSIG-ALLO + + version + + + Available after 3.6.1, report currently running version + + + + wipe-cache domain0. [domain1. domain2.] diff --git a/pdns/docs/rec_control.1.txt b/pdns/docs/rec_control.1.txt index 9e49da79e..1c3b3d1de 100644 --- a/pdns/docs/rec_control.1.txt +++ b/pdns/docs/rec_control.1.txt @@ -102,16 +102,19 @@ reload-zones:: set-minimum-ttl :: Set minimum-ttl-override. -trace-regex [regex]:: - Emit resolution trace for matching queries. Empty regex to disable trace. - top-remotes:: Shows the top-20 most active remote hosts. Statistics are over the last 'remotes-ringbuffer-entries' queries, which defaults to 0. +trace-regex [regex]:: + Emit resolution trace for matching queries. Empty regex to disable trace. + unload-lua-script:: Unloads Lua script. +version:: + Report running version (available after 3.6.1) + wipe-cache [domain1]:: Wipe entries from the cache. This is useful if, for example, an important server has a new IP address, but the TTL has not yet diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index b3ec8826e..df72fb96d 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -22,6 +22,7 @@ #include #include "lock.hh" #include "responsestats.hh" +#include "version_generated.h" #include "namespaces.hh" pthread_mutex_t g_carbon_config_lock=PTHREAD_MUTEX_INITIALIZER; @@ -664,6 +665,7 @@ string RecursorControlParser::getAnswer(const string& question, RecursorControlP "trace-regex [regex] emit resolution trace for matching queries (empty regex to clear trace)\n" "top-remotes show top remotes\n" "unload-lua-script unload Lua script\n" +"version return Recursor version number\n" "wipe-cache domain0 [domain1] .. wipe domain data from cache\n"; if(cmd=="get-all") @@ -679,6 +681,10 @@ string RecursorControlParser::getAnswer(const string& question, RecursorControlP *command=&doExit; return "bye\n"; } + + if(cmd=="version") { + return string(PDNS_VERSION)+"\n"; + } if(cmd=="quit-nicely") { *command=&doExitNicely; -- 2.49.0