On 09-Dec-1999, Irwan Hadi wrote:
> Setelah selesai install postfix, dan bisa jalan, bagaimana cara membuatnya
> otomatis jalan setiap kali komputer di restart , tanpa harus su dulu dan
> ketik postfix reload
'postfix reload' itu untuk mereload config, sedangkan untuk memulai
pake 'postfix start'.
Tergantung model init di system anda, kalo pake model SysV (kayak
redhat dkk), bisa pake script di bawah ini. Simpen ke
/etc/rc.d/init.d/postfix, terus jalanin 'chkconfig --add postfix',
defaultnya dia akan jalan di runlevel 2,3,4 dan 5. Kalo nggak ada
chkconfig bisa coba pake ntsysv.
#!/bin/sh
#
# postfix This shell script takes care of starting and stopping
# postfix.
#
# 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
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/postfix ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting postfix: "
newaliases
for I in access canonical relocated transport virtual
do
if [ -f /etc/postfix/$I ] ; then
/usr/sbin/postmap hash:/etc/postfix/$I < /etc/postfix/$I
fi
done
daemon /usr/sbin/postfix start
echo
touch /var/lock/subsys/postfix
;;
stop)
# Stop daemons.
echo -n "Shutting down postfix: "
killproc master
echo
rm -f /var/lock/subsys/postfix
;;
restart)
$0 stop
$0 start
;;
reload)
/usr/sbin/postfix reload
;;
status)
status master
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
--
Ronny Haryanto
--------------------------------------------------------------------------
Utk berhenti langganan, kirim email ke [EMAIL PROTECTED]
Informasi arsip di http://www.linux.or.id/milis.php3
Pengelola dapat dihubungi lewat [EMAIL PROTECTED]