< Exim
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
Use 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[edit]
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 <?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <!-- William Pool (Puddle) 02/05 Service manifest for Exim E-mail: [email protected] Modified for CSWexim by Markus Mayer <[email protected]>, 2006-01-08 Modified for MYexim By DrOwl [email protected], 2008-10-01 --> <service_bundle type='manifest' name='MYexim:exim'> <service name='network/exim' type='service' version='1'> <create_default_instance enabled='false' /> <single_instance /> <dependency name='fs-local' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/local' /> </dependency> <dependency name='network-service' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/network/service' /> </dependency> <dependent name='exim_multi-user-server' grouping='require_all' restart_on='none'> <service_fmri value='svc:/milestone/multi-user-server' /> </dependent> <exec_method type='method' name='start' exec='/lib/svc/method/smtp-exim start' timeout_seconds='60'> </exec_method> <exec_method type='method' name='stop' exec='/lib/svc/method/smtp-exim stop' timeout_seconds='60'> </exec_method> <exec_method type='method' name='refresh' exec='/lib/svc/method/smtp-exim refresh' timeout_seconds='60'> </exec_method> <exec_method type='method' name='restart' exec='/lib/svc/method/smtp-exim restart' timeout_seconds='60'> </exec_method> </service> </service_bundle>
The Method script[edit]
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 #! /bin/sh # # Written by Miquel van Smoorenburg <[email protected]>. # Modified for Debian GNU/Linux by Ian Murdock <[email protected]>. # Modified for exim by Tim Cutts <[email protected]> # Modified for Blastwave by Markus Mayer <[email protected]> # Modified for MYexim By DrOwl <[email protected]> # Exit if exim (or another MTA) runs from /etc/inetd.conf #if [ -f /etc/inetd.conf ] && grep "^ *\([0-9.]\+:\)\?smtp" /etc/inetd.conf >/dev/null; then # 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" # Exit if there's no exim binary if [ ! -x "$DAEMON" ] ; then echo "no exim binary found [$DAEMON]" exit 1 fi # Make sure we have exim.conf if [ ! -r "$CONFFILE" ] ; then echo "no exim config found [$CONFFILE]" exit 1 fi # Read customizable environment if it exists test -r "$ENVFILE" && . "$ENVFILE" # Use default parameters if $ENVFILE doesn't set $EXIM_PARAMS test -z "$EXIM_PARAMS" && EXIM_PARAMS=$DEF_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