Home | History | Annotate | Line # | Download | only in rc.d
postfix revision 1.6
      1 #!/bin/sh
      2 #
      3 # $NetBSD: postfix,v 1.6 2002/02/12 02:19:27 lukem Exp $
      4 #
      5 
      6 # PROVIDE: mail
      7 # REQUIRE: LOGIN
      8 #	we make mail start late, so that things like .forward's are not
      9 #	processed until the system is fully operational
     10 
     11 . /etc/rc.subr
     12 
     13 name="postfix"
     14 rcvar=$name
     15 required_files="/etc/${name}/main.cf"
     16 start_precmd="postfix_precmd"
     17 start_cmd="${name} start"
     18 stop_cmd="${name} stop"
     19 reload_cmd="${name} reload"
     20 extra_commands="reload"
     21 spooletcdir="/var/spool/${name}/etc"
     22 required_dirs=$spooletcdir
     23 
     24 postfix_precmd()
     25 {
     26 	# As this is called after the is_running and required_dir checks
     27 	# are made in run_rc_command(), we can safely assume ${spooletcdir}
     28 	# exists and postfix isn't running at this point (unless forcestart
     29 	# is used).
     30 	#
     31 
     32 	for f in localtime resolv.conf services; do
     33 		if [ -f /etc/$f ]; then
     34 			cmp -s /etc/$f ${spooletcdir}/$f || \
     35 			    cp -p /etc/$f ${spooletcdir}/$f
     36 		fi
     37 	done
     38 }
     39 
     40 load_rc_config $name
     41 run_rc_command "$1"
     42