unable to write pid to sendmail.pid

Anthony Peacock a.peacock at CHIME.UCL.AC.UK
Mon Oct 31 09:44:19 GMT 2005

> Julian Field wrote:
> > I'll have time this weekend to give it a quick look, I would like to
> > see what has been changed in SuSE 10 anyway, so I'll do a quick
> > install in VMWare. Exactly what command did you type and exactly
> > what output did you get? I don't like anything always producing an
> > error, something must be wrong so I want to fix it. It shouldn't
> > ever do that, it causes problems for novice users.
> Running on a SuSE 9.3 box.  Command was "rcMailScanner restart" (stock
> script from the install - not modified).  See the 12th line down for
> the error.  I interjected ERROR ---> in case line wrap screws up the
> line count. . It looks like sendmail-out apparently starts, but there


> ERROR ---> Oct 28 08:31:22 mxl sendmail-out[13735]: unable to write
> pid to /var/run/sendmail.pid: file in use by another process 


I fixed this on my Solaris boxes the other day.  I am still a luddite 
and manually install MailScanner, so I don't use Julian's install 
scripts and stop init.d files.  I too had been having this error come 
up on restart for a while, as everything was working fine, I ignored 
it.  Last week I had a spare 30 minutes and decided to work out how 
to fix it.

This error started with Sendmail 8.13.*, previous versions quitely 
overwrote the pid file if a second instance of Sendmail tried to 
write to the same file. This behvaiour changed in Sendmail 8.13, 
where Sendmail tries to write a PID file if run as a persitent queue 
runnner, and locks the pid files.

My Mailscanner setup requires three Sendmail instances running:

1)  The daemon listening on port 25, which places messages in the 
incoming queue, ready for MailScanner to process them.

2)  The perstistent queue runner that process messages in the 
outgoing queue, after MailScanner has processed them

3)  The local submit client.

Instances 1 and 3 have always written to different PID files, the 
change in behaviour for 8.13 means that instance 2 tries to write to 
a PID file, and uses the default file, which is already in use by 
instance 1.

I got around this by explicitly setting the PID file for instance 2 
with a command line switch.

So the three instances are started like this now (wrapped for 

/usr/lib/sendmail -L sm-mta -bd -ODeliveryMode=queueonly \
/usr/lib/sendmail -q15m -OPidFile=/var/run/sm-queue.pid
/usr/lib/sendmail -L sm-msp-queue -Ac -q30m

I don't know what will happen if you use the -OPidFile swicth for 
earlier versions of Sendmail.

Hope this helps.

Anthony Peacock       
CHIME, Royal Free & University College Medical School
WWW:    http://www.chime.ucl.ac.uk/~rmhiajp/
"On two occasions I have been asked [by members of Parliament!],
'Pray, Mr. Babbage, if you put into the machine wrong figures, will
the right answers come out?'  I am not able rightly to apprehend the
kind of confusion of ideas that could provoke such a
question.' -- Charles Babbage

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!

More information about the MailScanner mailing list