[Devel] [PATCH] Manage SIGHUP

2007-08-29 Thread [EMAIL PROTECTED]
Hi all,

usually SIGHUP is used in order to close and to reopen the log files (with
logrotate for example). Mbuni manage the SIGHUP as SIGTERM and quit the
application.
I attach my patch that manage the SIGHUP signal.

--- mmsbox/mmsbox.c 17 Jul 2007 08:26:36 -  1.35
+++ mmsbox/mmsbox.c 28 Aug 2007 13:29:57 -
@@ -40,6 +40,15 @@
   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. */
 static MIMEEntity *find_textpart(MIMEEntity *m)
 {
@@ -555,7 +564,7 @@

  mms_cfg_destroy(cfg);

- signal(SIGHUP, quit_now);
+ signal(SIGHUP, relog_now);
  signal(SIGTERM, quit_now);
  signal(SIGPIPE,SIG_IGN); /* Ignore pipe errors. They kill us
sometimes for nothing*/
___
Devel mailing list
Devel@mbuni.org
http://lists.mbuni.org/mailman/listinfo/devel


Re: [Devel] [PATCH] Manage SIGHUP

2007-08-29 Thread P. A. Bagyenda

Applied to CVS. Thanks

P.

On Aug 29, 2007, at 11:24, [EMAIL PROTECTED] wrote:


Hi all,

usually SIGHUP is used in order to close and to reopen the log  
files (with logrotate for example). Mbuni manage the SIGHUP as  
SIGTERM and quit the application.

I attach my patch that manage the SIGHUP signal.

--- mmsbox/mmsbox.c 17 Jul 2007 08:26:36 -  1.35
+++ mmsbox/mmsbox.c 28 Aug 2007 13:29:57 -
@@ -40,6 +40,15 @@
   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. */
 static MIMEEntity *find_textpart(MIMEEntity *m)
 {
@@ -555,7 +564,7 @@

  mms_cfg_destroy(cfg);

- signal(SIGHUP, quit_now);
+ signal(SIGHUP, relog_now);

  signal(SIGTERM, quit_now);
  signal(SIGPIPE,SIG_IGN); /* Ignore pipe errors. They kill us  
sometimes for nothing*/


___
Devel mailing list
Devel@mbuni.org
http://lists.mbuni.org/mailman/listinfo/devel


___
Devel mailing list
Devel@mbuni.org
http://lists.mbuni.org/mailman/listinfo/devel