summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/postfix
diff options
context:
space:
mode:
authorgordon <gordon@FreeBSD.org>2002-06-13 22:14:37 +0000
committergordon <gordon@FreeBSD.org>2002-06-13 22:14:37 +0000
commit9c5433cb225f7a4e56e87623ea2e4011179553a5 (patch)
tree3168589e209abd888b033397e3c46dee6131a116 /etc/rc.d/postfix
parent50d99cdfecd92f5323a18aa791a5b1cb9d8b7191 (diff)
downloadFreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.zip
FreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.tar.gz
Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next. Submitted by: Mike Makonnen <makonnen@pacbell.net> Reviewed by: silence on -current and -hackers Prodded by: rwatson
Diffstat (limited to 'etc/rc.d/postfix')
-rwxr-xr-xetc/rc.d/postfix34
1 files changed, 26 insertions, 8 deletions
diff --git a/etc/rc.d/postfix b/etc/rc.d/postfix
index b453464..807072b 100755
--- a/etc/rc.d/postfix
+++ b/etc/rc.d/postfix
@@ -1,24 +1,42 @@
#!/bin/sh
#
-# $NetBSD: postfix,v 1.4 2000/05/13 08:45:08 lukem Exp $
+# $NetBSD: postfix,v 1.6 2002/02/12 02:19:27 lukem Exp $
+# $FreeBSD$
#
# PROVIDE: mail
# REQUIRE: LOGIN
-
-# we could do this, but make mail start late, so that things like
-# .forward's are not processed until the system is fully operational
-## REQUIRE: DAEMON
+# 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_cmd="postfix start"
-stop_cmd="postfix stop"
-reload_cmd="postfix reload"
+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"
OpenPOWER on IntegriCloud