the problem I'm seeing is that the fork'd part of the program keeps starting over and over

Obviously, you're starting more children than are terminating. So, in order to debug the issue, I would write a little my_exit() routine, which you then call everywhere you're now calling the exit builtin. The my_exit() routine would log somewhere which process died, and then exit. In its most simple form something like

sub my_exit { my $from_where = shift; if (open my $log, ">>", "/tmp/mailscanner-debug.log") { print $log "$$ exited: $from_where\n"; close $log; } exit; }

so you can verify that the processes are actually terminating as expected (e.g. when the bind fails, etc.).

You might want to refine that routine as necessary, and also write similar entries (to the same logfile) whenever a new process is being created. Or generally add more debug logging... to get a clearer picture of what's going on.  (You could maybe use MailScanner::Log::InfoLog() instead of using an extra logfile. Not sure though if that would work properly — haven't looked at how it's implemented...)

Also, what exactly is your ExitLogging() doing?


In reply to Re^3: Problems with DBI::trace_msg by almut
in thread Problems with DBI::trace_msg by dirtdart

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.