#!/bin/bash # # postfix Postfix Mail Transfer Agent # # chkconfig: 2345 80 30 # description: Postfix is a Mail Transport Agent, which is the program \ # that moves mail from one machine to another. # processname: master # pidfile: /var/spool/postfix/pid/master.pid # config: /etc/postfix/main.cf # config: /etc/postfix/master.cf # # Based on startup script from Simon J Mudd # 25/02/99: Mostly s/sendmail/postfix/g by John A. Martin # 23/11/00: Changes & suggestions by Ajay Ramaswamy # 20/01/01: Changes to fall in line with RedHat 7.0 style # 23/02/01: Fix a few untidy problems with help from Daniel Roesen. # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -x /usr/sbin/postfix ] || exit 0 [ -d /opt/cluservices/postfix-imss ] || exit 0 [ -d /opt/cluservices/spool/postfix-imss ] || exit 0 RETVAL=0 start() { # Start daemons. echo -n "Starting postfix: " /usr/sbin/postfix -c /opt/cluservices/postfix-imss start 2>/dev/null 1>&2 && success || failure RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix-imss echo return $RETVAL } stop() { # Stop daemons. echo -n "Shutting down postfix: " /usr/sbin/postfix -c /opt/cluservices/postfix-imss stop 2>/dev/null 1>&2 && success || failure RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/postfix-imss echo return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) exit 0 ;; *) echo "Usage: $0 {start|stop|status}" exit 1 esac exit $?