Mercurial > prosody-hg
comparison plugins/mod_posix.lua @ 2342:8b20702d5b9e
mod_posix: Fix to not loop in SIGTERM either, but the same happens with SIGHUP (where the same 'fix' can't be applied) - shall investigate tomorrow
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 08 Dec 2009 01:24:16 +0000 |
| parents | 2a163f6a4bc2 |
| children | 65b794860e1b |
comparison
equal
deleted
inserted
replaced
| 2341:27584901ddb5 | 2342:8b20702d5b9e |
|---|---|
| 134 | 134 |
| 135 -- Set signal handlers | 135 -- Set signal handlers |
| 136 if signal.signal then | 136 if signal.signal then |
| 137 signal.signal("SIGTERM", function () | 137 signal.signal("SIGTERM", function () |
| 138 module:log("warn", "Received SIGTERM"); | 138 module:log("warn", "Received SIGTERM"); |
| 139 signal.signal("SIGTERM", function () end); -- Fixes us getting into some kind of loop | |
| 139 prosody.unlock_globals(); | 140 prosody.unlock_globals(); |
| 140 prosody.shutdown("Received SIGTERM"); | 141 prosody.shutdown("Received SIGTERM"); |
| 141 prosody.lock_globals(); | 142 prosody.lock_globals(); |
| 142 end); | 143 end); |
| 143 | 144 |
| 147 prosody.reopen_logfiles(); | 148 prosody.reopen_logfiles(); |
| 148 end); | 149 end); |
| 149 | 150 |
| 150 signal.signal("SIGINT", function () | 151 signal.signal("SIGINT", function () |
| 151 module:log("info", "Received SIGINT"); | 152 module:log("info", "Received SIGINT"); |
| 152 signal.signal("SIGINT", function () end); -- Fixes us getting into some kind of loop | 153 signal.signal("SIGINT", function () end); -- Fix to not loop |
| 153 prosody.unlock_globals(); | 154 prosody.unlock_globals(); |
| 154 prosody.shutdown("Received SIGINT"); | 155 prosody.shutdown("Received SIGINT"); |
| 155 prosody.lock_globals(); | 156 prosody.lock_globals(); |
| 156 end); | 157 end); |
| 157 end | 158 end |
