aboutsummaryrefslogtreecommitdiffstats
path: root/main/postfix/postfix.initd
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/postfix.initd
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/postfix.initd')
-rw-r--r--main/postfix/postfix.initd58
1 files changed, 41 insertions, 17 deletions
diff --git a/main/postfix/postfix.initd b/main/postfix/postfix.initd
index 45f1b49ce0..e578431f7d 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 $?
}