diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-05-05 14:20:26 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-05-05 14:20:26 +0100 |
commit | 794ba972aff856e82e95f20d593b8d318d23654b (patch) | |
tree | 8e18b577e3bfdd1834e4dfc747b96003fbc079b4 /prosody | |
parent | 2fff09895975e5b2fb3d0aee38c2f652c6029e15 (diff) | |
parent | a4afb372653da9df1bc407230838a7bb958242ac (diff) | |
download | prosody-794ba972aff856e82e95f20d593b8d318d23654b.tar.gz prosody-794ba972aff856e82e95f20d593b8d318d23654b.zip |
Merge with 0.4
Diffstat (limited to 'prosody')
-rwxr-xr-x | prosody | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -114,7 +114,27 @@ end); ----------- 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 }); |