X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosody;h=2febe4d8b7f0dd920ff601d1b80f0d1e0e99b384;hb=2c928cfc3f2525ab371f8705349ed6d8686edd01;hp=8e85847fdba8a38a1d26e32e4bd314a3b3d3751d;hpb=38e7f09f55562417e574540ed8685d5dc3a37d2d;p=prosody.git diff --git a/prosody b/prosody index 8e85847f..2febe4d8 100755 --- a/prosody +++ b/prosody @@ -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 }); @@ -156,6 +176,7 @@ end net_activate_ports("c2s", "xmppclient", {5222}, (global_ssl_ctx and "tls") or "tcp"); net_activate_ports("s2s", "xmppserver", {5269}, "tcp"); +net_activate_ports("component", "xmppcomponent", {}, "tcp"); net_activate_ports("legacy_ssl", "xmppclient", {}, "ssl"); if cl.get("console") then