mod_traceback/mod_traceback.lua
author Nicholas George <wirlaburla@worlio.com>
Sat, 08 Jun 2024 03:28:25 -0500
changeset 5926 f408b8e603af
parent 5855 dde9d21a599f
permissions -rw-r--r--
mod_server_info: fix dataforms require

module:set_global();

local traceback = require "util.debug".traceback;

local signal = module:get_option_string(module.name, "SIGUSR1");
module:hook("signal/" .. signal, function()
	module:log("info", "Received %s, writing traceback", signal);
	local f = io.open(prosody.paths.data .. "/traceback.txt", "a+");
	f:write(traceback(), "\n");
	f:close();
end);