sendmail 8.12.7 squawking after MS 4.11-1 upgrade

Jeremy Evans JeremyE at BSA.CA.GOV
Thu Jan 23 22:09:00 GMT 2003


This new patch works on my OpenBSD 3.2 box (sendmail 8.12.6, MailScanner
4.11-1).  No more annoying messages.  Thank you very much.

-----Original Message-----
From: Julian Field [mailto:mailscanner at ECS.SOTON.AC.UK]
Sent: Thursday, January 23, 2003 1:48 PM
To: MAILSCANNER at JISCMAIL.AC.UK
Subject: Re: sendmail 8.12.7 squawking after MS 4.11-1 upgrade


Right. I've built 8.12.7 and managed to reproduce the problem. I appear to
have a solution, which closes the filehandles to break the connection with
the tty, and re-opens them after all the daemonising has been done.

Instead of the last patch, try applying this one: (and yes, I know it looks
dead simple, but it has taken hours to get right :-)

--- /usr/sbin/MailScanner       Sun Jan 19 12:39:20 2003
+++ MailScanner Thu Jan 23 22:53:48 2003
@@ -37,6 +37,7 @@
  require 5.005;

  use FileHandle;
+use IO::Handle;
  use MailScanner::Config;
  use MailScanner::CustomConfig;
  use MailScanner::Lock;
@@ -261,6 +262,12 @@
  # If we are debugging, then just run once.
  #
  sub WorkForHours {
+  # Re-open the stdin, stdout and stderr file descriptors for
+  # sendmail's benefit. Should stop it squawking!
+  open(STDIN,  "</dev/null");
+  open(STDOUT, ">/dev/null");
+  open(STDERR, ">/dev/null");
+
    # Read the configuration file and start logging to syslog/stderr
    StartLogging($ConfFile);



At 20:06 23/01/2003, you wrote:
>Nope, I've only been getting the messages about stderr (same error both
>before and after the patch).
>
>-----Original Message-----
>From: Julian Field [mailto:mailscanner at ECS.SOTON.AC.UK]
>Sent: Thursday, January 23, 2003 12:00 PM
>To: MAILSCANNER at JISCMAIL.AC.UK
>Subject: Re: sendmail 8.12.7 squawking after MS 4.11-1 upgrade
>
>
>At 19:49 23/01/2003, you wrote:
> >Unfortunately, after applying the patch, I'm still getting the error:
> >
> >sendmail[30488]: File descriptors missing on startup: stderr; Bad file
> >descriptor
>
>Does it still produce the errors about stdin and stdout as well?
>
> >This is on an OpenBSD 3.2 box.  I rebooted the machine beforehand, and
>still
> >got the error when I sent a message.  Then I killed MailScanner and sent
a
> >message, without getting an error (so it goes into mqueue.in without
> >problems).  When I restarted MailScanner, I got the error shortly
>thereafter
> >(probably when it transfers the mail back to sendmail to send out).  I
> >haven't had a problem with mail being modified or deleted (except when it
>is
> >supposed to, i.e. bad attachment filename), so the message is more of an
> >annoyance than anything else.  Still, it would be nice to get rid of it.
> >
> >Jeremy Evans
> >Information Systems Analyst
> >California State Auditor
> >916-445-0255 phone
> >916-322-7801 fax
> >
> >
> >-----Original Message-----
> >From: Julian Field [mailto:mailscanner at ECS.SOTON.AC.UK]
> >Sent: Thursday, January 23, 2003 11:21 AM
> >To: MAILSCANNER at JISCMAIL.AC.UK
> >Subject: Re: sendmail 8.12.7 squawking after MS 4.11-1 upgrade
> >
> >
> >Oops, you're right of course.
> >Must remember not to code with one hand while drinking wine with the
other
> >:-)
> >Revised patch is below...
> >
> >At 19:12 23/01/2003, you wrote:
> > >Shouldn't:
> > >
> > >+  $io0->fdopen(fileno(STDIN), "r"));
> > >+  $io1->fdopen(fileno(STDOUT),"w"));
> > >+  $io2->fdopen(fileno(STDERR),"w"));
> > >
> > >be:
> > >
> > >+  $io0->fdopen(fileno(STDIN), "r");
> > >+  $io1->fdopen(fileno(STDOUT),"w");
> > >+  $io2->fdopen(fileno(STDERR),"w");
> > >
> > >in the patch?
> >
> >Revised patch is
> >
> >--- /usr/sbin/MailScanner      Sun Jan 19 12:39:20 2003
> >+++ MailScanner Thu Jan 23 19:56:35 2003
> >@@ -37,6 +37,7 @@
> >   require 5.005;
> >
> >   use FileHandle;
> >+use IO::Handle;
> >   use MailScanner::Config;
> >   use MailScanner::CustomConfig;
> >   use MailScanner::Lock;
> >@@ -261,6 +262,16 @@
> >   # If we are debugging, then just run once.
> >   #
> >   sub WorkForHours {
> >+  # Re-open the stdin, stdout and stderr file descriptors for
> >+  # sendmail's benefit. Should stop it squawking!
> >+  my($io0, $io1, $io2);
> >+  $io0 = new IO::Handle;
> >+  $io1 = new IO::Handle;
> >+  $io2 = new IO::Handle;
> >+  $io0->fdopen(fileno(STDIN), "r");
> >+  $io1->fdopen(fileno(STDOUT),"w");
> >+  $io2->fdopen(fileno(STDERR),"w");
> >+
> >     # Read the configuration file and start logging to syslog/stderr
> >     StartLogging($ConfFile);
> >
> >--
> >Julian Field
> >www.MailScanner.info
> >MailScanner thanks transtec Computers for their support
>
>--
>Julian Field
>www.MailScanner.info
>MailScanner thanks transtec Computers for their support

--
Julian Field
www.MailScanner.info
MailScanner thanks transtec Computers for their support



More information about the MailScanner mailing list