List Info

Thread: dbmail-imapd stopped after SIGHUP




dbmail-imapd stopped after SIGHUP
country flaguser name
Russian Federation
2007-08-19 10:22:13
Hello!

We're uging DBMail 2.2.5 from EPEL (Extra Packages for
Enterprise Linux by RedHat/Fedora Project) - http://download.fedora.redhat.com/pub/epel
/5/i386/repoview/dbmail.html .

Sources of dbmail from EPEL contains next patch:
------------------------ begin patch
Index: server.c
============================================================
=======
--- server.c    (revision 2646)
+++ server.c    (revision 2647)
 -172,20
+172,36 
        return Restart;
 }

-pid_t server_daemonize(serverConfig_t *conf)
+/* Should be called after a HUP to allow for log rotation,
+ * as the filesystem may want to give us new inodes and/or
+ * the user may have changed the log file configs. */
+static void reopen_logs(serverConfig_t *conf)
 {
        int serr;
-       assert(conf);
+
+       if (! (freopen(conf->log, "a",
stdout))) {
+               serr = errno;
+               TRACE(TRACE_ERROR, "freopen failed on
[%s] [%s]",
+                               conf->log,
strerror(serr));
+       }
+       if (! (freopen(conf->error_log, "a",
stderr))) {
+               serr = errno;
+               TRACE(TRACE_ERROR, "freopen failed on
[%s] [%s]",
+                               conf->error_log,
strerror(serr));
+       }
+       if (! (freopen("/dev/null", "r",
stdin))) {
+               serr = errno;
+               TRACE(TRACE_ERROR, "freopen failed on
stdin [%s]",
+                               strerror(serr));
+       }
+}

-       if (fork())
-               exit(0);
-       setsid();
-       if (fork())
-               exit(0);
+/* Should be called once to initially close the actual
std{in,out,err}
+ * and open the redirection files. */
+static void reopen_logs_fatal(serverConfig_t *conf)
+{
+       int serr;

-       chdir("/");
-       umask(0077);
-
        if (! (freopen(conf->log, "a",
stdout))) {
                serr = errno;
                TRACE(TRACE_FATAL, "freopen failed on
[%s] [%s]",
 -201,7
+217,23 
                TRACE(TRACE_FATAL, "freopen failed on
stdin [%s]",
                                strerror(serr));
        }
+}

+pid_t server_daemonize(serverConfig_t *conf)
+{
+       assert(conf);
+
+       if (fork())
+               exit(0);
+       setsid();
+       if (fork())
+               exit(0);
+
+       chdir("/");
+       umask(0077);
+
+       reopen_logs_fatal(conf);
+
        TRACE(TRACE_DEBUG, "sid: [%d]",
getsid(0));

        return getsid(0);
 -225,6
+257,8 
        int serrno, status, result = 0;
        pid_t pid = -1;

+       reopen_logs(conf);
+
        CreateSocket(conf);

        switch ((pid = fork())) {
------------------------ end patch

I noticed than exist bug http://dbmai
l.org/mantis/view.php?id=600 .

DBMail built with patch above but in any case dbmail-imapd
just stop sometimes on logrotate (e.g. receiving SIGHUP).

How to solve this problem?

--
Ilyas
_______________________________________________
DBmail mailing list
DBmaildbmail.org
htt
ps://mailman.fastxs.nl/mailman/listinfo/dbmail

Re: dbmail-imapd stopped after SIGHUP
country flaguser name
United States
2007-08-26 21:28:31
umask wrote:
> We're uging DBMail 2.2.5 from EPEL (Extra Packages for
Enterprise Linux by RedHat/Fedora Project) - http://download.fedora.redhat.com/pub/epel
/5/i386/repoview/dbmail.html .
> 
> Sources of dbmail from EPEL contains next patch:
> ------------------------ begin patch
[patch deleted]
> ------------------------ end patch
> 
> I noticed than exist bug http://dbmai
l.org/mantis/view.php?id=600 .
> 
> DBMail built with patch above but in any case
dbmail-imapd just stop sometimes on logrotate (e.g.
receiving SIGHUP).
> 
> How to solve this problem?

Are you able to get a stacktrace when dbmail-imapd
terminates?  I was
never able to get that myself.  I think that would be useful
information
in fixing the problem.

_______________________________________________
DBmail mailing list
DBmaildbmail.org
htt
ps://mailman.fastxs.nl/mailman/listinfo/dbmail

Re: Re: dbmail-imapd stopped after SIGHUP
country flaguser name
Russian Federation
2007-08-27 04:57:20

27.08.07, 06:28, Bernard Johnson
(bjohnson-dated-1188786362.9495bdsymetrix.com):

> umask wrote:
> > We're uging DBMail 2.2.5 from EPEL (Extra Packages
for Enterprise Linux by RedHat/Fedora Project) - http://download.fedora.redhat.com/pub/epel
/5/i386/repoview/dbmail.html .
> > 
> > Sources of dbmail from EPEL contains next patch:
> > ------------------------ begin patch
> [patch deleted]
> > ------------------------ end patch
> > 
> > I noticed than exist bug http://dbmai
l.org/mantis/view.php?id=600 .
> > 
> > DBMail built with patch above but in any case
dbmail-imapd just stop sometimes on logrotate (e.g.
receiving SIGHUP).
> > 
> > How to solve this problem?
> Are you able to get a stacktrace when dbmail-imapd
terminates?  I was
> never able to get that myself.  I think that would be
useful information
> in fixing the problem.

Bernard, how I can get stacktrace?
In my case dbmail-imapd receive SIGHUP which send logrotate
at 04:10 AM every week.


> _______________________________________________
> DBmail mailing list
> DBmaildbmail.org
> htt
ps://mailman.fastxs.nl/mailman/listinfo/dbmail
_______________________________________________
DBmail mailing list
DBmaildbmail.org
htt
ps://mailman.fastxs.nl/mailman/listinfo/dbmail

Re: dbmail-imapd stopped after SIGHUP
country flaguser name
United States
2007-08-27 11:21:48
umask wrote:
> Bernard, how I can get stacktrace?
> In my case dbmail-imapd receive SIGHUP which send
logrotate at 04:10 AM every week.

Run it under a debugger (gdb).  If it terminates abnormally,
type 'bt'
in the debugger to get the trace.

If it exits normally, then we have other issues 

_______________________________________________
DBmail mailing list
DBmaildbmail.org
htt
ps://mailman.fastxs.nl/mailman/listinfo/dbmail

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )