This is a discussion on Re: Worried about Postfix startup (new install) within the mailing.postfix.users forums, part of the Mail Servers and Related category; dalive@flashmail.com (DALive Editor) writes: > I just installed Postfix, I had erased my pervious Sendmail rpm > installtion ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
dalive@flashmail.com (DALive Editor) writes:
> I just installed Postfix, I had erased my pervious Sendmail rpm > installtion to the best of my knowledge. The init.d startup script for > Sendmal stayed behind. I installed Postfix from source, > successfully. I later shutdown my server, before I even really started > palyin with postfix. On bootup I realise that Postfix is running, > becuase the root has mail. '$ service sendmail start' works. However > '$ service sendmail stop' does not. Can anyone explain to me how > Postfix got started? And also where can I find a sample Postfix init.d > startup script. I may have missed reference to one in that INSTALL > file if there was any such reference. The enclosed file is what is included in my rpm. It should do what you want. Install it as /etc/rc.d/init.d/postfix and works on rh5-9 and other distributions. #!/bin/sh # # 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 # # $Revision: 2.1.2.1 $ # # Written by Package Author: Simon J Mudd <sjmudd@pobox.com> # 25/02/99: Mostly s/sendmail/postfix/g by John A. Martin <jam@jamux.com> # 23/11/00: Changes & suggestions by Ajay Ramaswamy <ajayr@bigfoot.com> # 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 /etc/postfix ] || exit 0 [ -d /var/spool/postfix ] || exit 0 RETVAL=0 start() { # Start daemons. echo -n "Starting postfix: " /usr/sbin/postfix start 2>/dev/null 1>&2 && success || failure RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix echo return $RETVAL } stop() { # Stop daemons. echo -n "Shutting down postfix: " /usr/sbin/postfix stop 2>/dev/null 1>&2 && success || failure RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/postfix echo return $RETVAL } reload() { echo -n "Reloading postfix: " /usr/sbin/postfix reload 2>/dev/null 1>&2 && success || failure RETVAL=$? echo return $RETVAL } restart() { stop start } abort() { /usr/sbin/postfix abort 2>/dev/null 1>&2 && success || failure return $? } flush() { /usr/sbin/postfix flush 2>/dev/null 1>&2 && success || failure return $? } check() { /usr/sbin/postfix check 2>/dev/null 1>&2 && success || failure return $? } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) reload ;; abort) abort ;; flush) flush ;; check) check ;; status) status master ;; condrestart) # don't use /var/lock/subsys/postfix, check for postfix running directly daemon_directory=$(postconf -h daemon_directory) $daemon_directory/master -t 2>/dev/null && : || restart ;; *) echo "Usage: postfix {start|stop|restart|reload|abort|flush|check|statu s|condrestart}" exit 1 esac exit $? |