# HG changeset patch # User Matthew Wild # Date 1602853285 -3600 # Node ID 96da09c771a1acc0f0aae2736231c17c8839b229 # Parent 44bcddecf1b5fb35808b672400decee54d78d47b mod_posix: Hook and fire events on SIGUSR1/2 diff -r 44bcddecf1b5 -r 96da09c771a1 plugins/mod_posix.lua --- a/plugins/mod_posix.lua Fri Oct 16 13:44:51 2020 +0100 +++ b/plugins/mod_posix.lua Fri Oct 16 14:01:25 2020 +0100 @@ -147,5 +147,20 @@ prosody.shutdown("Received SIGINT"); prosody.lock_globals(); end); + + signal.signal("SIGUSR1", function () + module:log("info", "Received SIGUSR1"); + module:fire_event("signal/SIGUSR1"); + end); + + signal.signal("SIGUSR2", function () + module:log("info", "Received SIGUSR2"); + module:fire_event("signal/SIGUSR2"); + end); end); end + +-- For other modules to reference +features = { + signal_events = true; +};