summaryrefslogtreecommitdiffstats
path: root/main/postfix
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-01-19 12:19:07 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-01-19 12:19:07 +0000
commit86afb7175b68ae54d508ec258188607473e4c670 (patch)
tree1778a1004ada47692f045d3d46c99cd886141f4f /main/postfix
parent837150e087891264f567ad5dddbb962d37019121 (diff)
downloadaports-86afb7175b68ae54d508ec258188607473e4c670.tar.bz2
aports-86afb7175b68ae54d508ec258188607473e4c670.tar.xz
main/postfix: init.d script fixes
sync with gentoo's init.d - replace opts variable. ref #943 - add abort and flush extra commands
Diffstat (limited to 'main/postfix')
-rw-r--r--main/postfix/APKBUILD4
-rw-r--r--main/postfix/postfix.initd58
2 files changed, 43 insertions, 19 deletions
diff --git a/main/postfix/APKBUILD b/main/postfix/APKBUILD
index 7627e4fe1..52d067c97 100644
--- a/main/postfix/APKBUILD
+++ b/main/postfix/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postfix
pkgver=2.8.7
-pkgrel=0
+pkgrel=1
pkgdesc="Secure and fast drop-in replacement for Sendmail (MTA)"
url="http://www.postfix.org/"
arch="all"
@@ -153,7 +153,7 @@ pgsql() { _mv_dict pgsql ; }
sqlite() { _mv_dict sqlite ; }
md5sums="b3ff47a38db920fc15bb207f42da53db postfix-2.8.7.tar.gz
-6bbabcd041aefaf40e1f3ee1fc1d6d7e postfix.initd
+d773f01dcc965d219a8a37b88f89c5bf postfix.initd
632fce950f64aa0794f9c2af85d45423 0001-support-for-dynamic-maps.patch
442efd1a95b0c061dfb8ab75456e0f24 dynamicmaps.cf
2ebe51a882eb9d6d7866583eb6af3969 postfix-ldap.post-install
diff --git a/main/postfix/postfix.initd b/main/postfix/postfix.initd
index 45f1b49ce..e578431f7 100644
--- a/main/postfix/postfix.initd
+++ b/main/postfix/postfix.initd
@@ -1,26 +1,31 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/files/postfix.rc6.2.5,v 1.3 2008/08/18 14:18:40 falco Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/files/postfix.rc6.2.6,v 1.3 2011/10/24 12:52:32 eras Exp $
-# If you plan to simultaneously use several Postfix instances, don't forget
-# to specify your alternate_config_directories variable in your main main.cf file.
-# Then make a symlink from /etc/init.d/postfix to /etc/init.d/postfix.alt,
-# prepare your new /etc/postfix.alt environment, and at least change these working paths:
-# queue_directory = /var/spool/postfix.alt
-# data_directory = /var/lib/postfix.alt
+# Please read http://www.postfix.org/MULTI_INSTANCE_README.html for multi instance support
CONF_DIR="/etc/postfix"
CONF_OPT="${SVCNAME##*.}"
if [ -n ${CONF_OPT} -a ${SVCNAME} != "postfix" ]; then
CONF_DIR="${CONF_DIR}.${CONF_OPT}"
fi
+if [ "${CONF_DIR}" = "/etc/postfix" ]; then
+ CONF_PARAM=""
+ CONF_MESSAGE=""
+else
+ CONF_PARAM="-c ${CONF_DIR}"
+ CONF_MESSAGE="(${CONF_DIR})"
+fi
+
+extra_started_commands="reload abort flush"
-opts="${opts} reload"
+description_reload="Re-read configuration files. Running processes terminate at their earliest convenience."
+description_abort="Stop the Postfix mail system abruptly. Running processes are signaled to stop immediately."
+description_flush="Force delivery: attempt to deliver every message in the deferred mail queue."
depend() {
- use logger dns ypbind amavisd mysql postgresql antivirus \
- postfix_greylist net saslauthd
+ use logger dns ypbind amavisd antivirus postfix_greylist net saslauthd
after firewall
if [ "${SVCNAME}" = "postfix" ]; then
provide mta
@@ -28,23 +33,42 @@ depend() {
}
start() {
- ebegin "Starting postfix (${CONF_DIR})"
+ if [ ! -z "${CONF_PARAM}" ]; then
+ einfo "Please consider updating your config for postmulti support."
+ fi
+ ebegin "Starting postfix ${CONF_MESSAGE}"
if [ ! -d ${CONF_DIR} ]; then
eend 1 "${CONF_DIR} does not exist"
return 1
fi
- /usr/sbin/postfix -c ${CONF_DIR} start >/dev/null 2>&1
+ /usr/sbin/postfix ${CONF_PARAM} start >/dev/null 2>&1
eend $?
}
stop() {
- ebegin "Stopping postfix (${CONF_DIR})"
- /usr/sbin/postfix -c ${CONF_DIR} stop >/dev/null 2>&1
+ ebegin "Stopping postfix ${CONF_MESSAGE}"
+ /usr/sbin/postfix ${CONF_PARAM} stop >/dev/null 2>&1
eend $?
}
reload() {
- ebegin "Reloading postfix (${CONF_DIR})"
- /usr/sbin/postfix -c ${CONF_DIR} reload >/dev/null 2>&1
+ ebegin "Reloading postfix ${CONF_MESSAGE}"
+ /usr/sbin/postfix ${CONF_PARAM} reload >/dev/null 2>&1
+ eend $?
+}
+
+abort() {
+ ebegin "Aborting postfix ${CONF_MESSAGE}"
+
+ if service_started "${SVCNAME}"; then
+ mark_service_stopped "${SVCNAME}"
+ fi
+ /usr/sbin/postfix ${CONF_PARAM} abort >/dev/null 2>&1
+ eend $?
+}
+
+flush() {
+ ebegin "Flushing postfix ${CONF_MESSAGE}"
+ /usr/sbin/postfix ${CONF_PARAM} flush >/dev/null 2>&1
eend $?
}