public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in mail-mta/postfix/files: postfix.rc6.2.7
@ 2012-03-06 15:03 Eray Aslan (eras)
  0 siblings, 0 replies; only message in thread
From: Eray Aslan (eras) @ 2012-03-06 15:03 UTC (permalink / raw
  To: gentoo-commits

eras        12/03/06 15:03:53

  Added:                postfix.rc6.2.7
  Log:
  add checking to start() in init script
  
  (Portage version: 2.1.10.49/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  mail-mta/postfix/files/postfix.rc6.2.7

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/files/postfix.rc6.2.7?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/files/postfix.rc6.2.7?rev=1.1&content-type=text/plain

Index: postfix.rc6.2.7
===================================================================
#!/sbin/runscript
# Copyright 1999-2012 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.7,v 1.1 2012/03/06 15:03:53 eras Exp $

# 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"

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 antivirus postfix_greylist net saslauthd
	if [ "${SVCNAME}" = "postfix" ]; then
		provide mta
	fi
}

start() {
	local _retval
	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 ${CONF_PARAM} start >/dev/null 2>&1
	_retval=$?
	# check that master started correctly
	if [ "${_retval}" ]; then
		sleep 1
		/usr/sbin/postfix ${CONF_PARAM} status >/dev/null 2>&1
		_retval=$?
	fi
	eend "${_retval}"
}

stop() {
	ebegin "Stopping postfix ${CONF_MESSAGE}"
	/usr/sbin/postfix ${CONF_PARAM} stop >/dev/null 2>&1
	eend $?
}

reload() {
	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 $?
}






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-06 15:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-06 15:03 [gentoo-commits] gentoo-x86 commit in mail-mta/postfix/files: postfix.rc6.2.7 Eray Aslan (eras)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox