diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-10-16 14:01:25 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-10-16 14:01:25 +0100 |
commit | 8f059290a719e2dd5aba81477749863c0c663350 (patch) | |
tree | 804c59336243fb57ea733cdb159e4bef1474ee6a /plugins | |
parent | 2cd052169656478fd62a0fad5f37f1902f2f9f2d (diff) | |
download | prosody-8f059290a719e2dd5aba81477749863c0c663350.tar.gz prosody-8f059290a719e2dd5aba81477749863c0c663350.zip |
mod_posix: Hook and fire events on SIGUSR1/2
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_posix.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua index d3ff1f7c..03177530 100644 --- a/plugins/mod_posix.lua +++ b/plugins/mod_posix.lua @@ -147,5 +147,20 @@ if have_signal then 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; +}; |