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