启动脚本

/etc/init.d/postfix

[root@linuxas3 init.d]# vi /etc/init.d/postfix
#!/bin/sh
#
#   Startup/shutdown script for the Postfix (Mail Server).
#
#   Linux chkconfig stuff:
#
#   chkconfig: 2345 95 50
#   description: Startup/shutdown script for the Common UNIX \
#                Postfix (Mail Server).
#
#   Copyright 2004 by netkiller, all rights reserved.
#
#      author: netkiller
#       Voice: +86 13322993040
#       EMail: openunix@163.com
#         WWW: http://www.9812.net
#
# heavily edited so that it's more like other scripts in init.d on Red Hat
# Linux


POSTFIX=/usr/sbin/postfix
clamav=/usr/local/clamav/sbin/clamd
POP3=/usr/lib/courier-imap/libexec/pop3d.rc
IMAP=/usr/lib/courier-imap/libexec/imapd.rc
SQWEBMAIL=/bin/false
#/usr/local/webmail/libexec/authlib/authdaemond
case "$1" in
    start)
        if [ -x ${POSTFIX} ]; then
            service saslauthd start
            ${clamav}
            service amavisd start
            ${POSTFIX} start > /dev/null && echo -n 'Postfix Starting...'
            ${POP3} start
            ${IMAP} start
            ${SQWEBMAIL} start
        fi
        echo
        ;;
    stop)
        if [ -x ${POSTFIX} ]; then
            ${POP3} stop
            ${IMAP} stop
            ${SQWEBMAIL} stop
            service amavisd stop
            service saslauthd stop
            ${POSTFIX} stop > /dev/null 2>&1 && echo -n 'Postfix Stop...'
        fi
        echo
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    *)
        echo ""
        echo "Usage: `basename $0` { start | stop | restart }"
        echo ""
        exit 1
        ;;
esac
		

设计启动级别

[root@linux init.d]# chkconfig --level 345 postfix  on