Mercurial > prosody-modules
annotate mod_traceback/mod_traceback.lua @ 5858:761142ee0ff2
mod_http_oauth2: Reflect changes to defaults etc
- Resource owner password grant was disabled by default
- Tokens now include a hash of client_id making it possible to be
reasonable sure that they were issued to a particular client
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 05 Mar 2024 00:32:00 +0100 |
parents | dde9d21a599f |
children |
rev | line source |
---|---|
2773
7a4e8dbbd30d
mod_traceback: Write current stack trace to file on SIGUSR1
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 module:set_global(); |
7a4e8dbbd30d
mod_traceback: Write current stack trace to file on SIGUSR1
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 |
7a4e8dbbd30d
mod_traceback: Write current stack trace to file on SIGUSR1
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 local traceback = require "util.debug".traceback; |
7a4e8dbbd30d
mod_traceback: Write current stack trace to file on SIGUSR1
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 |
5851
dde9d21a599f
mod_traceback: Hook signal via event instead of directly
Kim Alvefur <zash@zash.se>
parents:
2773
diff
changeset
|
5 local signal = module:get_option_string(module.name, "SIGUSR1"); |
dde9d21a599f
mod_traceback: Hook signal via event instead of directly
Kim Alvefur <zash@zash.se>
parents:
2773
diff
changeset
|
6 module:hook("signal/" .. signal, function() |
dde9d21a599f
mod_traceback: Hook signal via event instead of directly
Kim Alvefur <zash@zash.se>
parents:
2773
diff
changeset
|
7 module:log("info", "Received %s, writing traceback", signal); |
dde9d21a599f
mod_traceback: Hook signal via event instead of directly
Kim Alvefur <zash@zash.se>
parents:
2773
diff
changeset
|
8 local f = io.open(prosody.paths.data .. "/traceback.txt", "a+"); |
2773
7a4e8dbbd30d
mod_traceback: Write current stack trace to file on SIGUSR1
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 f:write(traceback(), "\n"); |
7a4e8dbbd30d
mod_traceback: Write current stack trace to file on SIGUSR1
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 f:close(); |
7a4e8dbbd30d
mod_traceback: Write current stack trace to file on SIGUSR1
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 end); |
7a4e8dbbd30d
mod_traceback: Write current stack trace to file on SIGUSR1
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 |