aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-10-16 14:01:25 +0100
committerMatthew Wild <mwild1@gmail.com>2020-10-16 14:01:25 +0100
commit8f059290a719e2dd5aba81477749863c0c663350 (patch)
tree804c59336243fb57ea733cdb159e4bef1474ee6a
parent2cd052169656478fd62a0fad5f37f1902f2f9f2d (diff)
downloadprosody-8f059290a719e2dd5aba81477749863c0c663350.tar.gz
prosody-8f059290a719e2dd5aba81477749863c0c663350.zip
mod_posix: Hook and fire events on SIGUSR1/2
-rw-r--r--plugins/mod_posix.lua15
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;
+};