1
0
Fork 0

minor fix for SIGHUP handling

This commit is contained in:
bagyenda 2007-08-29 10:14:45 +00:00
parent 89a6e5007d
commit 3789d199a7
3 changed files with 27 additions and 3 deletions

View File

@ -40,6 +40,14 @@ static void quit_now(int notused)
http_close_port(mmc->incoming.port); http_close_port(mmc->incoming.port);
} }
/* manage the SIGHUP signal */
static void relog_now(int notused)
{
warning(0, "SIGHUP received, catching and re-opening logs");
log_reopen();
alog_reopen();
}
/* Finds text part, returns copy. */ /* Finds text part, returns copy. */
static MIMEEntity *find_textpart(MIMEEntity *m) static MIMEEntity *find_textpart(MIMEEntity *m)
{ {
@ -576,7 +584,7 @@ int main(int argc, char *argv[])
mms_cfg_destroy(cfg); mms_cfg_destroy(cfg);
signal(SIGHUP, quit_now); signal(SIGHUP, relog_now);
signal(SIGTERM, quit_now); signal(SIGTERM, quit_now);
signal(SIGPIPE,SIG_IGN); /* Ignore pipe errors. They kill us sometimes for nothing*/ signal(SIGPIPE,SIG_IGN); /* Ignore pipe errors. They kill us sometimes for nothing*/

View File

@ -52,6 +52,14 @@ static void quit_now(int notused)
} }
} }
/* manage the SIGHUP signal */
static void relog_now(int notused)
{
warning(0, "SIGHUP received, catching and re-opening logs");
log_reopen();
alog_reopen();
}
static void free_clientInfo(MmsHTTPClientInfo *h, int freeh); static void free_clientInfo(MmsHTTPClientInfo *h, int freeh);
static void fetchmms_proxy(MmsHTTPClientInfo *h); static void fetchmms_proxy(MmsHTTPClientInfo *h);
static void sendmms_proxy(MmsHTTPClientInfo *h); static void sendmms_proxy(MmsHTTPClientInfo *h);
@ -97,7 +105,7 @@ int main(int argc, char *argv[])
panic(0, "No global MMSC configuration!"); panic(0, "No global MMSC configuration!");
signal(SIGHUP, quit_now); signal(SIGHUP, relog_now);
signal(SIGTERM, quit_now); signal(SIGTERM, quit_now);
/* Start cache engine. */ /* Start cache engine. */

View File

@ -23,6 +23,14 @@ static void quit_now(int notused)
rstop = 1; rstop = 1;
} }
/* manage the SIGHUP signal */
static void relog_now(int notused)
{
warning(0, "SIGHUP received, catching and re-opening logs");
log_reopen();
alog_reopen();
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int cfidx; int cfidx;
@ -63,7 +71,7 @@ int main(int argc, char *argv[])
mms_start_profile_engine(octstr_get_cstr(settings->ua_profile_cache_dir)); mms_start_profile_engine(octstr_get_cstr(settings->ua_profile_cache_dir));
#endif #endif
signal(SIGHUP, quit_now); signal(SIGHUP, relog_now);
signal(SIGTERM, quit_now); signal(SIGTERM, quit_now);
signal(SIGPIPE,SIG_IGN); /* Ignore pipe errors. They kill us sometimes for nothing*/ signal(SIGPIPE,SIG_IGN); /* Ignore pipe errors. They kill us sometimes for nothing*/