Software /
code /
prosody
Comparison
plugins/mod_posix.lua @ 11179:96da09c771a1
mod_posix: Hook and fire events on SIGUSR1/2
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 16 Oct 2020 14:01:25 +0100 |
parent | 11062:dd3b1b9d867d |
child | 11830:7fe2fbfbdb1c |
comparison
equal
deleted
inserted
replaced
11178:44bcddecf1b5 | 11179:96da09c771a1 |
---|---|
145 module:log("info", "Received SIGINT"); | 145 module:log("info", "Received SIGINT"); |
146 prosody.unlock_globals(); | 146 prosody.unlock_globals(); |
147 prosody.shutdown("Received SIGINT"); | 147 prosody.shutdown("Received SIGINT"); |
148 prosody.lock_globals(); | 148 prosody.lock_globals(); |
149 end); | 149 end); |
150 | |
151 signal.signal("SIGUSR1", function () | |
152 module:log("info", "Received SIGUSR1"); | |
153 module:fire_event("signal/SIGUSR1"); | |
154 end); | |
155 | |
156 signal.signal("SIGUSR2", function () | |
157 module:log("info", "Received SIGUSR2"); | |
158 module:fire_event("signal/SIGUSR2"); | |
159 end); | |
150 end); | 160 end); |
151 end | 161 end |
162 | |
163 -- For other modules to reference | |
164 features = { | |
165 signal_events = true; | |
166 }; |