mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 22:46:41 +08:00
Issue #23
change signal SIGHUP action from abort process to ignore log signal value when process aborted by signal
This commit is contained in:
parent
37b3a07b9f
commit
ec36627f91
@ -12,10 +12,10 @@
|
|||||||
#if _PREDIXY_BACKTRACE_
|
#if _PREDIXY_BACKTRACE_
|
||||||
|
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
inline void traceInfo()
|
inline void traceInfo(int sig)
|
||||||
{
|
{
|
||||||
#define Size 128
|
#define Size 128
|
||||||
logError("predixy backtrace");
|
logError("predixy backtrace(%d)", sig);
|
||||||
void* buf[Size];
|
void* buf[Size];
|
||||||
int num = ::backtrace(buf, Size);
|
int num = ::backtrace(buf, Size);
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
@ -32,9 +32,9 @@ inline void traceInfo()
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
inline void traceInfo()
|
inline void traceInfo(int sig)
|
||||||
{
|
{
|
||||||
logError("predixy backtrace, but current system unspport backtrace");
|
logError("predixy backtrace(%d), but current system unspport backtrace", sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -27,7 +27,7 @@ static bool Stop = false;
|
|||||||
static void abortHandler(int sig)
|
static void abortHandler(int sig)
|
||||||
{
|
{
|
||||||
if (!Abort) {
|
if (!Abort) {
|
||||||
traceInfo();
|
traceInfo(sig);
|
||||||
}
|
}
|
||||||
Abort = true;
|
Abort = true;
|
||||||
if (!Running) {
|
if (!Running) {
|
||||||
@ -65,6 +65,7 @@ Proxy::~Proxy()
|
|||||||
|
|
||||||
bool Proxy::init(int argc, char* argv[])
|
bool Proxy::init(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
signal(SIGHUP, SIG_IGN);
|
||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
signal(SIGFPE, abortHandler);
|
signal(SIGFPE, abortHandler);
|
||||||
signal(SIGILL, abortHandler);
|
signal(SIGILL, abortHandler);
|
||||||
@ -72,7 +73,6 @@ bool Proxy::init(int argc, char* argv[])
|
|||||||
signal(SIGABRT, abortHandler);
|
signal(SIGABRT, abortHandler);
|
||||||
signal(SIGBUS, abortHandler);
|
signal(SIGBUS, abortHandler);
|
||||||
signal(SIGQUIT, abortHandler);
|
signal(SIGQUIT, abortHandler);
|
||||||
signal(SIGHUP, abortHandler);
|
|
||||||
signal(SIGINT, stopHandler);
|
signal(SIGINT, stopHandler);
|
||||||
signal(SIGTERM, stopHandler);
|
signal(SIGTERM, stopHandler);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user