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 | 543b2d7d0099a25ce0a1200df94557820f75786b (patch) | |
tree | 804c59336243fb57ea733cdb159e4bef1474ee6a | |
parent | ae33d82d359731bb3ed25873ec28d67ff8fd7b45 (diff) | |
download | prosody-543b2d7d0099a25ce0a1200df94557820f75786b.tar.gz prosody-543b2d7d0099a25ce0a1200df94557820f75786b.zip |
mod_posix: Hook and fire events on SIGUSR1/2
-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; +}; |