From jdc@koitsu.dyndns.org  Tue Feb 13 16:21:07 2007
Return-Path: <jdc@koitsu.dyndns.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 822AE16A406
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Feb 2007 16:21:07 +0000 (UTC)
	(envelope-from jdc@koitsu.dyndns.org)
Received: from rwcrmhc14.comcast.net (rwcrmhc14.comcast.net [204.127.192.84])
	by mx1.freebsd.org (Postfix) with ESMTP id 77D2D13C4A7
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Feb 2007 16:21:07 +0000 (UTC)
	(envelope-from jdc@koitsu.dyndns.org)
Received: from icarus.home.lan (c-71-198-0-135.hsd1.ca.comcast.net[71.198.0.135])
          by comcast.net (rwcrmhc14) with ESMTP
          id <20070213162104m1400k22c6e>; Tue, 13 Feb 2007 16:21:04 +0000
Received: by icarus.home.lan (Postfix, from userid 1000)
	id 718451FA01D; Tue, 13 Feb 2007 08:21:04 -0800 (PST)
Message-Id: <20070213162104.718451FA01D@icarus.home.lan>
Date: Tue, 13 Feb 2007 08:21:04 -0800 (PST)
From: Jeremy Chadwick <koitsu@FreeBSD.org>
Reply-To: Jeremy Chadwick <koitsu@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: postfix rc.d startup enhancement, postfix_flags
X-Send-Pr-Version: 3.113
X-GNATS-Notify: vivek@khera.org

>Number:         109137
>Category:       ports
>Synopsis:       postfix rc.d startup enhancement, postfix_flags
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    koitsu
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 13 16:30:03 GMT 2007
>Closed-Date:    Tue Feb 20 22:39:26 GMT 2007
>Last-Modified:  Tue Feb 20 22:40:05 GMT 2007
>Originator:     Jeremy Chadwick
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD icarus.home.lan 6.2-STABLE FreeBSD 6.2-STABLE #0: Wed Jan 31 15:39:07 PST 2007 root@icarus.home.lan:/usr/obj/usr/src/sys/ICARUS i386
>Description:
I happen to store many of my postfix configuration files in a
different directory than PREFIX/etc/postfix.  I store things
like aliases, generic, main.cf, master.cf, and transport all in
/conf/ME/postfix.

Up until now, my postfix installation/upgrade has consisted
of installing the port, then doing this:

	# cd /usr/local/etc/postfix
	# rm main.cf master.cf
	# ln -s /conf/ME/postfix/main.cf
	# ln -s /conf/ME/postfix/master.cf

I came across the manpage entry for postfix(8) which says that
you can use "-c directory" to the postfix start/stop command
to specify an alternate location of a postfix installation, or
use -v or -D for logging verbosity/debugging.  I decided to make
a $postfix_flags variable in rc.d/postfix which would allow
these flags to be passed to postfix(8) when starting.  Thus I
can now do in rc.conf:

	postfix_enable="yes"
	postfix_flags="-c /conf/ME/postfix"

...and no longer require symlinks in PREFIX/etc/postfix.  (Using
that method also makes a mess when doing a postfix upgrade, since
the configuration backup/restore doesn't handle symlinks how I'd
like.  :)  No need to change that though.)

There's one caveat: PREFIX/etc/postfix also contains a couple
necessary scripts and files, such as makedefs.out, post-install,
postfix-files, and postfix-script (the most important one).
Those who want to use the -c dir option will have to do something
like this, or else postfix-script and friends won't work:

	# cd /conf/ME/postfix
	# ln -s /usr/local/etc/postfix/makedefs.out
	# ln -s /usr/local/etc/postfix/post-install
	# ln -s /usr/local/etc/postfix/postfix-files
	# ln -s /usr/local/etc/postfix/postfix-script

The reason for this is that the postfix(8) script explicitly looks
for postfix-script as $config_directory/postfix-script.  It's not
a bug; it's just how things are done in postfix(8).
>How-To-Repeat:
n/a
>Fix:
Apply the below patch.


--- files/postfix.sh.in.orig	Wed Jul 19 05:59:11 2006
+++ files/postfix.sh.in	Tue Feb 13 08:03:25 2007
@@ -14,6 +14,8 @@
 # postfix_procname (command):	Set command that start master. Used to verify if
 #				postfix is running.
 #				Default is "%%PREFIX%%/libexec/postfix/master".
+# postfix_flags (str):		Flags passed to postfix-script on start-up.
+#				Default is "".
 #
 
 . %%RC_SUBR%%
@@ -26,6 +28,7 @@
 : ${postfix_enable="NO"}
 : ${postfix_pidfile="/var/spool/postfix/pid/master.pid"}
 : ${postfix_procname="%%PREFIX%%/libexec/postfix/master"}
+: ${postfix_flags=""}
 
 start_cmd=${name}_start
 stop_cmd=${name}_stop
@@ -35,11 +38,11 @@
 procname=${postfix_procname}
 
 postfix_start() {
-	%%PREFIX%%/sbin/postfix start
+	%%PREFIX%%/sbin/postfix ${postfix_flags} start
 }
 
 postfix_stop() {
-	%%PREFIX%%/sbin/postfix stop
+	%%PREFIX%%/sbin/postfix ${postfix_flags} stop
 }
 
 run_rc_command "$1"
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->koitsu 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Feb 13 21:27:49 UTC 2007 
Responsible-Changed-Why:  
Submitter has GNATS access 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109137 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Tue Feb 13 21:28:15 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback 

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

From: Vivek Khera <vivek@khera.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/109137: mail/postfix rc.d startup enhancement, postfix_flags
Date: Tue, 13 Feb 2007 16:57:40 -0500

 On Feb 13, 2007, at 4:28 PM, Edwin Groothuis wrote:
 
 > Maintainer of mail/postfix,
 >
 > Please note that PR ports/109137 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.
 
 I approve the application of this patch.
 
 I don't see the need to increment PORTREVISION on this change, as it  
 doesn't affect any existing users.
State-Changed-From-To: feedback->closed 
State-Changed-By: koitsu 
State-Changed-When: Tue Feb 20 22:39:25 UTC 2007 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/109137: commit references a PR
Date: Tue, 20 Feb 2007 22:36:48 +0000 (UTC)

 koitsu      2007-02-20 22:36:40 UTC
 
   FreeBSD ports repository
 
   Modified files:
     mail/postfix/files   postfix.sh.in 
     mail/postfix-current/files postfix.sh.in 
   Log:
   Addition of postfix_flags variable to rc.subr startup script.
   This variable is passed to postfix-script on startup, allowing
   administrators to do things like postfix_flags="-c /my/place/postfix"
   (alternate location of main.cf and master.cf), or postfix_flags="-v"
   (for verbose logging).  See postfix(1) manpage for flags.
   
   PR:             ports/109137
   Reviewed by:    Vivek Khera <vivek@khera.org>
   Approved by:    philip
   
   Revision  Changes    Path
   1.5       +6 -3      ports/mail/postfix-current/files/postfix.sh.in
   1.5       +6 -3      ports/mail/postfix/files/postfix.sh.in
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
