/etc/init.d script for Solaris?

Julian Field mailscanner at ecs.soton.ac.uk
Mon Aug 14 19:34:25 IST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

PATH=/usr/bin:/bin
SENDMAIL=/opt/sendmail/current
MAILSCANNER=/opt/MailScanner

case $1 in
'start')
         $SENDMAIL/bin/start.sendmail
         $MAILSCANNER/bin/check_mailscanner
         ;;

'stop')
         pid=`head -1 $SENDMAIL/etc/sendmail.pid`
         echo 'Stopping sendmail (out)...'
         kill $pid
         pid=`head -1 $SENDMAIL/etc/sendmail.in.pid`
         echo 'Stopping sendmail (in)...'
         kill $pid
         pid=`head -1 $MAILSCANNER/var/MailScanner.pid`
         /bin/kill $pid
         ;;

*)
         echo "usage: /etc/rc2.d/S88sendmail.ecs {start|stop}"
         ;;

esac


===========================
and start.sendmail is this:
===========================


#!/bin/sh

# JKF 13/7/98 Start up sendmail.
#             Cleans up the queue directory as instructed in the
#             "Sendmail Installation and Operation Guide" before
#             starting the daemon.
# JKF 15/6/99 Added hook to install my ECS sendmail setup automatically.

SENDMAIL=/opt/sendmail/current
QUEUE=/var/spool/mqueue
INQUEUE=/var/spool/mqueue.in
CF=$SENDMAIL/etc/sendmail.cf

# Install everything if necessary (needed after careless Sun patching)
[ -x $SENDMAIL/bin/install.sendmail ] && $SENDMAIL/bin/install.sendmail

# Make placeholders for status files
[ -d $SENDMAIL/var/status ]      || mkdir $SENDMAIL/var/status
[ -f $SENDMAIL/var/sendmail.st ] || touch $SENDMAIL/var/sendmail.st

echo "Starting sendmail:\c"

echo " clean up queue\c"
for queuedir in $QUEUE $INQUEUE
do
   cd $queuedir

   # remove zero length qf files
   for qffile in qf*
   do
         if [ -r $qffile ]; then
                 if [ ! -s $qffile ]; then
                         rm -f $qffile
                 fi
         fi
   done
   # rename tf files to be qf if the qf does not exist
   for tffile in tf*
   do
         qffile=`echo $tffile | sed 's/t/q/'`
         # JKF 15/7/98 Put $qffile in quotes in case tffile = 'tf*'
         if [ -r $tffile -a ! -f "$qffile" ]; then
                 mv $tffile $qffile
         else
                 if [ -f $tffile ]; then
                         rm -f $tffile
                 fi
         fi
   done
   # remove df files with no corresponding qf files
   for dffile in df*
   do
         qffile=`echo $dffile | sed 's/d/q/'`
         if [ -r $dffile -a ! -f $qffile ]; then
                 mv $dffile `echo $dffile | sed 's/d/D/'`
         fi
   done
   # announce files that have been saved during disaster recovery
   for xffile in [A-Z]f*
   do
         if [ -f $xffile ]; then
                 echo " <saved mail spool $xffile>\c"
         fi
   done
done

# Now actually start the damn thing...
$SENDMAIL/bin/sendmail -q15m
$SENDMAIL/bin/sendmail -bd -OPrivacyOptions=noetrn 
- -ODeliveryMode=queueonly -OQueueDirectory=/var/spool/mqueue.in
#$SENDMAIL/bin/sendmail.in -bd -C $INCF
echo ", sendmail"




Jeff A. Earickson wrote:
> Hi,
> 
> Could some kind Solaris 10 (or 9) MailScanner user, using a recent 
> version of MailScanner, please send me their /etc/init.d
> start script for MailScanner?  Offlist?
> 
> Thanks,
> Jeff Earickson
> Colby College

- -- 
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store

MailScanner customisation, or any advanced system administration help?
Contact me at Jules at MailScanner.biz

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
For all your IT requirements visit www.transtec.co.uk

-----BEGIN PGP SIGNATURE-----
Version: PGP SDK 3.7.0
Charset: ISO-8859-1

wj8DBQFE4MI5EfZZRxQVtlQRAmq9AKC4JQJvZoeYXaXaMqVU74rVAa3QfwCfV/ke
L7cbrrMNHeBWptymiVQwCkA=
=5JfV
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
For all your IT requirements visit www.transtec.co.uk



More information about the MailScanner mailing list