reload-acls
: Reloads ACLs.
-reload-lua-script *FILENAME*
-: (Re)loads Lua script *FILENAME*. This replaces the script currently loaded.
+reload-lua-script [*FILENAME*]
+: (Re)loads Lua script *FILENAME*. If *FILENAME* is empty, attempt to reload
+ the currently loaded script. This replaces the script currently loaded.
+
+reload-lua-config [*FILENAME*]
+: (Re)loads Lua configuration *FILENAME*. If *FILENAME* is empty, attempt to
+ reload the currently loaded file. Note that *FILENAME* will be fully executed,
+ any settings changed at runtime that are not modified in this file, will
+ still be active.
reload-zones
: Reload authoritative and forward zones. Retains current configuration
"quit-nicely stop the recursor daemon nicely\n"
"reload-acls reload ACLS\n"
"reload-lua-script [filename] (re)load Lua script\n"
+"reload-lua-config [filename] (re)load Lua configuration file\n"
"reload-zones reload all auth and forward zones\n"
"set-minimum-ttl value set minimum-ttl-override\n"
"set-carbon-server set a carbon server for telemetry\n"
if(cmd=="reload-lua-script")
return doQueueReloadLuaScript(begin, end);
+ if(cmd=="reload-lua-config") {
+ if(begin != end)
+ ::arg().set("lua-config-file") = *begin;
+
+ try {
+ loadRecursorLuaConfig(::arg()["lua-config-file"]);
+ L<<Logger::Warning<<"Reloaded Lua configuration file '"<<::arg()["lua-config-file"]<<"', requested via control channel"<<endl;
+ return "Reloaded Lua configuration file '"+::arg()["lua-config-file"]+"'\n";
+ }
+ catch(std::exception& e) {
+ return "Unable to load Lua script from '"+::arg()["lua-config-file"]+"': "+e.what()+"\n";
+ }
+ catch(const PDNSException& e) {
+ return "Unable to load Lua script from '"+::arg()["lua-config-file"]+"': "+e.reason+"\n";
+ }
+ }
+
if(cmd=="set-carbon-server")
return doSetCarbonServer(begin, end);