Software /
code /
prosody-modules
Comparison
mod_traceback/mod_traceback.lua @ 2773:7a4e8dbbd30d
mod_traceback: Write current stack trace to file on SIGUSR1
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 25 Sep 2017 11:20:05 +0100 |
child | 5875:dde9d21a599f |
comparison
equal
deleted
inserted
replaced
2772:2c59f2f0c37d | 2773:7a4e8dbbd30d |
---|---|
1 module:set_global(); | |
2 | |
3 local traceback = require "util.debug".traceback; | |
4 | |
5 require"util.signal".signal(module:get_option_string(module.name, "SIGUSR1"), function () | |
6 module:log("info", "Received SIGUSR1, writing traceback"); | |
7 local f = io.open(prosody.paths.data.."/traceback.txt", "a+"); | |
8 f:write(traceback(), "\n"); | |
9 f:close(); | |
10 end); | |
11 |