[BACK]Return to postfix CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

File: [cvs.NetBSD.org] / src / etc / rc.d / postfix (download)

Revision 1.6, Tue Feb 12 02:19:27 2002 UTC (22 years, 1 month ago) by lukem
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, fvdl_fs64_base
Changes since 1.5: +25 -8 lines

populate /var/spool/postfix/etc with /etc/{localtime,resolv.conf,services}.
per suggestion from perry.

#!/bin/sh
#
# $NetBSD: postfix,v 1.6 2002/02/12 02:19:27 lukem Exp $
#

# PROVIDE: mail
# REQUIRE: LOGIN
#	we make mail start late, so that things like .forward's are not
#	processed until the system is fully operational

. /etc/rc.subr

name="postfix"
rcvar=$name
required_files="/etc/${name}/main.cf"
start_precmd="postfix_precmd"
start_cmd="${name} start"
stop_cmd="${name} stop"
reload_cmd="${name} reload"
extra_commands="reload"
spooletcdir="/var/spool/${name}/etc"
required_dirs=$spooletcdir

postfix_precmd()
{
	# As this is called after the is_running and required_dir checks
	# are made in run_rc_command(), we can safely assume ${spooletcdir}
	# exists and postfix isn't running at this point (unless forcestart
	# is used).
	#

	for f in localtime resolv.conf services; do
		if [ -f /etc/$f ]; then
			cmp -s /etc/$f ${spooletcdir}/$f || \
			    cp -p /etc/$f ${spooletcdir}/$f
		fi
	done
}

load_rc_config $name
run_rc_command "$1"