prosody

changeset 1116
507702cf44f8
parent 1106
b51a65066595
child 1220
8e977f4262b4
--- a/prosody	Tue May 05 13:24:17 2009 +0100
+++ b/prosody	Tue May 05 14:17:06 2009 +0100
@@ -114,7 +114,27 @@
 
 ----------- End of out-of-place code --------------
 
--- Global function to initiate prosody shutdown
+-- Function to reload the config file
+function prosody_reload_config()
+	log("info", "Reloading configuration file");
+	eventmanager.fire_event("reloading-config");
+	local ok, level, err = config.load((rawget(_G, "CFG_CONFIGDIR") or ".").."/prosody.cfg.lua");
+	if not ok then
+		if level == "parser" then
+			log("error", "There was an error parsing the configuration file: %s", tostring(err));
+		elseif level == "file" then
+			log("error", "Couldn't read the config file when trying to reload: %s", tostring(err));
+		end
+	end
+end
+
+-- Function to reopen logfiles
+function prosody_reopen_logfiles()
+	log("info", "Re-opening log files");
+	eventmanager.fire_event("reopen-log-files"); -- Handled by appropriate log sinks
+end
+
+-- Function to initiate prosody shutdown
 function prosody_shutdown(reason)
 	log("info", "Shutting down: %s", reason or "unknown reason");
 	eventmanager.fire_event("server-stopping", { reason = reason });

mercurial