mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Support SIGABRT to generate coredump.
This commit is contained in:
parent
1d503c770f
commit
0304e78cf1
2 changed files with 14 additions and 0 deletions
|
@ -294,6 +294,11 @@ srs_error_t SrsSignalManager::start()
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
sa.sa_flags = 0;
|
sa.sa_flags = 0;
|
||||||
sigaction(SRS_SIGNAL_GRACEFULLY_QUIT, &sa, NULL);
|
sigaction(SRS_SIGNAL_GRACEFULLY_QUIT, &sa, NULL);
|
||||||
|
|
||||||
|
sa.sa_handler = SrsSignalManager::sig_catcher;
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
sa.sa_flags = 0;
|
||||||
|
sigaction(SRS_SIGNAL_ASSERT_ABORT, &sa, NULL);
|
||||||
|
|
||||||
sa.sa_handler = SrsSignalManager::sig_catcher;
|
sa.sa_handler = SrsSignalManager::sig_catcher;
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
|
@ -971,6 +976,13 @@ srs_error_t SrsServer::cycle()
|
||||||
|
|
||||||
void SrsServer::on_signal(int signo)
|
void SrsServer::on_signal(int signo)
|
||||||
{
|
{
|
||||||
|
// For signal to quit with coredump.
|
||||||
|
if (signo == SRS_SIGNAL_ASSERT_ABORT) {
|
||||||
|
srs_trace("abort with coredump, signo=%d", signo);
|
||||||
|
srs_assert(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (signo == SRS_SIGNAL_RELOAD) {
|
if (signo == SRS_SIGNAL_RELOAD) {
|
||||||
srs_trace("reload config, signo=%d", signo);
|
srs_trace("reload config, signo=%d", signo);
|
||||||
signal_reload = true;
|
signal_reload = true;
|
||||||
|
|
|
@ -125,6 +125,8 @@
|
||||||
// The signal for srs to gracefully quit, do carefully dispose then exit.
|
// The signal for srs to gracefully quit, do carefully dispose then exit.
|
||||||
// @see https://github.com/ossrs/srs/issues/1579
|
// @see https://github.com/ossrs/srs/issues/1579
|
||||||
#define SRS_SIGNAL_GRACEFULLY_QUIT SIGQUIT
|
#define SRS_SIGNAL_GRACEFULLY_QUIT SIGQUIT
|
||||||
|
// The signal for SRS to abort by assert(false).
|
||||||
|
#define SRS_SIGNAL_ASSERT_ABORT SIGABRT
|
||||||
|
|
||||||
// The application level signals.
|
// The application level signals.
|
||||||
// Persistence the config in memory to config file.
|
// Persistence the config in memory to config file.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue