summaryrefslogtreecommitdiff
path: root/mail/postfix/files
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2004-03-07 10:13:46 +0000
committergrant <grant@pkgsrc.org>2004-03-07 10:13:46 +0000
commit5bab0492f1cbde021f865269ad68b9f52a30737c (patch)
treeb54e6f9d4a74a018d74df659cd65d0afccc3bfe8 /mail/postfix/files
parent5f2459f81d699a473e83926718a4a4f6ab74a6b4 (diff)
downloadpkgsrc-5bab0492f1cbde021f865269ad68b9f52a30737c.tar.gz
install rc.subr-style script on all platforms but NetBSD-1.5 and above
(which already has a suitable /etc/rc.d/postfix).
Diffstat (limited to 'mail/postfix/files')
-rw-r--r--mail/postfix/files/postfix.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/mail/postfix/files/postfix.sh b/mail/postfix/files/postfix.sh
new file mode 100644
index 00000000000..a91f7104503
--- /dev/null
+++ b/mail/postfix/files/postfix.sh
@@ -0,0 +1,41 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: postfix.sh,v 1.1 2004/03/07 10:13:46 grant 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="@PKG_SYSCONFDIR@/main.cf"
+start_precmd="postfix_precmd"
+start_cmd="${name} "'${rc_arg}'
+stop_cmd=$start_cmd
+reload_cmd=$start_cmd
+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"