From 8f059290a719e2dd5aba81477749863c0c663350 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 16 Oct 2020 14:01:25 +0100 Subject: mod_posix: Hook and fire events on SIGUSR1/2 --- plugins/mod_posix.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'plugins/mod_posix.lua') 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; +}; -- cgit v1.2.3