sendmail startup scripts

Paul Howarth paul at city-fan.org
Thu Jun 9 09:52:04 UTC 2005


On Thu, 2005-06-09 at 08:50 +0100, Bryan Hepworth wrote:
> Hi Everyone
>  
> This is a general question so please bear with me on this request...
>  
> I had to install an antivirus product on the two sendmail servers we
> have at work. The installation and subsequent capture of viruses works
> fine but I'm not happy with the startup procedure, which could have
> been a bit more refined.
>  
> To start everything running you need the listener to start all in the
> following order:-
>  
> /usr/sbin/sendmail -bd -q10m -C /etc/mail/sendmail.cf.listen
> /usr/sbin/sendmail -q10m -C /etc/mail/sendmail.cf
> /usr/sbin/sendmail -q10m -C /etc/mail/submit.cf
>  
> I'd really like this to happen in the startup scripts /etc/init.d
> rather than stopping all the services and restarting one by one. It's
> more of an automation so that if the box did fall over they would all
> come back up on boot with no manual intervention.
>  
> My scripting knowledge is so far pretty poor so I'd really appreciate
> some constructive pointers on the scripts themselves and integrating
> things like this.

It's best not to edit the standard startup scripts because your edits
could get lost when an updated sendmail package (e.g. a security update)
gets installed.

The last two of the three daemons you need can be done using the
standard sendmail initscript. To get the queue retry interval set to 10
minutes for both the MTA and the MSP as you have them above, and with
the standard MTA not listening as a daemon, put the following
in /etc/sysconfig/sendmail:

DAEMON=no
QUEUE=10m
SMQUEUE=10m

The "SMQUEUE" setting is actually redundant since it will default to the
QUEUE setting if not specified.

All you need then is an additional initscript, called before the
standard one, to start up the daemon that listens for incoming mail.

You can use a modified version of the standard sendmail initscript to
handle this daemon. The attached sendmail.kap script should be a
reasonable starting point. Copy it to /etc/rc.d/init.d and do:

# chmod 755 /etc/rc.d/init.d/sendmail.kap
# chkconfig --add sendmail.kap
# chkconfig sendmail.kap reset

Your three daemons should then start and stop in the desired order.

Paul.
-- 
Paul Howarth <paul at city-fan.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sendmail.kap
Type: application/x-shellscript
Size: 2026 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20050609/08f19a5e/attachment-0001.bin>


More information about the fedora-list mailing list