From sa2c@sa2c.net  Thu Jan 12 19:31:46 2006
Return-Path: <sa2c@sa2c.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 359FE16A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 12 Jan 2006 19:31:46 +0000 (GMT)
	(envelope-from sa2c@sa2c.net)
Received: from sakura.and.or.jp (sakura.and.or.jp [59.106.20.85])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CE5BC43D45
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 12 Jan 2006 19:31:45 +0000 (GMT)
	(envelope-from sa2c@sa2c.net)
Received: from sakura.and.or.jp (localhost [127.0.0.1])
	by sakura.and.or.jp (Postfix) with ESMTP id 55A7661C29
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Jan 2006 04:31:40 +0900 (JST)
Received: from berkeley.l.sa2c.net (berkeley.vpn.and.or.jp [10.46.49.3])
	by sakura.and.or.jp (Postfix) with ESMTP id 32B8761C25
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Jan 2006 04:31:40 +0900 (JST)
Received: by berkeley.l.sa2c.net (Postfix, from userid 3104)
	id 22E3B11456; Fri, 13 Jan 2006 04:31:40 +0900 (JST)
Message-Id: <20060112193140.22E3B11456@berkeley.l.sa2c.net>
Date: Fri, 13 Jan 2006 04:31:40 +0900 (JST)
From: NIIMI Satoshi <sa2c@sa2c.net>
Reply-To: NIIMI Satoshi <sa2c@sa2c.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: mail/postfix: "etc/rc.d/postfix.sh restart" may fail
X-Send-Pr-Version: 3.113
X-GNATS-Notify: vivek@khera.org

>Number:         91721
>Category:       ports
>Synopsis:       mail/postfix: "etc/rc.d/postfix.sh restart" may fail
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mnag
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 12 19:40:05 GMT 2006
>Closed-Date:    Thu Jan 12 20:39:12 GMT 2006
>Last-Modified:  Thu Jan 12 20:39:12 GMT 2006
>Originator:     NIIMI Satoshi
>Release:        FreeBSD 6.0-RELEASE-p2 i386
>Organization:
>Environment:
System: FreeBSD berkeley.l.sa2c.net 6.0-RELEASE-p2 FreeBSD 6.0-RELEASE-p2 #1: Wed Jan 11 18:32:57 JST 2006 root@berkeley.l.sa2c.net:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
Running "${PREFIX}/etc/rc.d/postfix.sh restart" may produce an error

postfix/postfix-script: fatal: the Postfix mail system is already running

if "postfix stop" takes some time.  It is because the postfix(8)
command just sends a signal to the master(8) daemon and does not wait
the process to be stopped.

The PID file should be checked to restart the daemon reliably.

	
>How-To-Repeat:
	
>Fix:

	

--- postfix.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/postfix/Makefile,v
retrieving revision 1.105
diff -u -r1.105 Makefile
--- Makefile	12 Jan 2006 16:23:59 -0000	1.105
+++ Makefile	12 Jan 2006 19:17:27 -0000
@@ -16,7 +16,7 @@
 
 PORTNAME=	postfix
 PORTVERSION=	2.2.8
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES=	mail ipv6
 MASTER_SITES=	ftp://ftp.porcupine.org/mirrors/postfix-release/official/ \
Index: files/postfix.sh.in
===================================================================
RCS file: /home/ncvs/ports/mail/postfix/files/postfix.sh.in,v
retrieving revision 1.1
diff -u -r1.1 postfix.sh.in
--- files/postfix.sh.in	12 Jan 2006 16:23:59 -0000	1.1
+++ files/postfix.sh.in	12 Jan 2006 19:15:46 -0000
@@ -14,6 +14,8 @@
 # DO NOT CHANGE THESE DEFAULT VALUES HERE
 #
 postfix_enable="${postfix_enable-NO}"
+postfix_pidfile="${postfix_pidfile:-/var/spool/postfix/pid/master.pid}"
+postfix_procname="${postfix_procname:-/usr/local/libexec/postfix/master}"
 
 . %%RC_SUBR%%
 
@@ -23,6 +25,9 @@
 start_cmd=${name}_start
 stop_cmd=${name}_stop
 
+pidfile=${postfix_pidfile}
+procname=${postfix_procname}
+
 postfix_start() {
 	%%PREFIX%%/sbin/postfix start
 }
--- postfix.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Jan 12 19:44:09 UTC 2006 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=91721 
Responsible-Changed-From-To: freebsd-ports-bugs->mnag 
Responsible-Changed-By: mnag 
Responsible-Changed-When: Thu Jan 12 19:57:14 UTC 2006 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=91721 

From: Vivek Khera <vivek@khera.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/91721: mail/postfix: "etc/rc.d/postfix.sh restart" may fail
Date: Thu, 12 Jan 2006 14:56:44 -0500

 I approve, with one minor change.
 
 the postfix_procname variable default should use %%PREFIX%% rather  
 than /usr/local directly.
 
 On Jan 12, 2006, at 2:44 PM, Edwin Groothuis wrote:
 
 > Maintainer of mail/postfix,
 >
 > Please note that PR ports/91721 has just been submitted.
 >
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 >
 > The full text of the PR can be found at:
 >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/91721
 >
 > -- 
 > Edwin Groothuis
 > edwin@FreeBSD.org
 
State-Changed-From-To: feedback->closed 
State-Changed-By: mnag 
State-Changed-When: Thu Jan 12 20:39:11 UTC 2006 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=91721 
>Unformatted:
