Exim/SMF

This is a example for a Solaris 10 service config for exim Its quite basic and is a hack from a few others i found so is probably flawed

Us there commands to import and start the exim service
/usr/sbin/svccfg import /var/svc/manifest/network/smtp-exim.xml /usr/sbin/svcadm enable svc:network/exim

The manifest script
This is an xml script used by Solaris 10 SMF to be saved as "/var/svc/manifest/network/smtp-exim.xml"

> cat /var/svc/manifest/network/smtp-exim.xml

 <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>



  

     

 

 

 </exec_method>

 </exec_method>

</service_bundle>

The Method script
This is basically the same as the old init.d scripts and should be saved as "lib/svc/method/smtp-exim" > cat lib/svc/method/smtp-exim


 * 1) ! /bin/sh
 * 2) Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
 * 3) Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
 * 4) Modified for exim by Tim Cutts <timc@chiark.greenend.org.uk>
 * 5) Modified for Blastwave by Markus Mayer <mmayer@blastwave.org>
 * 6) Modified for MYexim By DrOwl <mail@catsnest.co.uk>
 * 1) Modified for MYexim By DrOwl <mail@catsnest.co.uk>


 * 1) Exit if exim (or another MTA) runs from /etc/inetd.conf
 * 2) if [ -f /etc/inetd.conf ] && grep "^ *\([0-9.]\+:\)\?smtp" /etc/inetd.conf >/dev/null; then
 * 3)    exit 0
 * fi

DAEMON=/usr/exim/bin/exim PIDFILE=/var/spool/exim/exim-daemon.pid CONFFILE=/usr/exim/configure ENVFILE=/usr/exim/exim-env.sh DEF_EXIM_PARAMS="-bd -q30m"

if [ ! -x "$DAEMON" ] ; then echo "no exim binary found [$DAEMON]" exit 1 fi
 * 1) Exit if there's no exim binary

if [ ! -r "$CONFFILE" ] ; then echo "no exim config found [$CONFFILE]" exit 1 fi
 * 1) Make sure we have exim.conf

test -r "$ENVFILE" &&. "$ENVFILE"
 * 1) Read customizable environment if it exists

test -z "$EXIM_PARAMS" && EXIM_PARAMS=$DEF_EXIM_PARAMS
 * 1) Use default parameters if $ENVFILE doesn't set $EXIM_PARAMS

case "$1" in start)    echo "Starting MTA: \c"    $DAEMON $EXIM_PARAMS    echo "exim."    ;;  stop) echo "Stopping MTA: \c" kill `cat "$PIDFILE"` echo "exim." ;; restart)    echo "Restarting MTA: \c"    kill `cat "$PIDFILE"`    $DAEMON $EXIM_PARAMS    echo "exim."    ;;  reload|refresh|force-reload) echo "Reloading exim configuration files" kill -1 `cat "$PIDFILE"` ;; *)    echo "Usage: $0 {start|stop|restart|reload}"    exit 1    ;; esac

exit 0