From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Feb 13 16:30:03 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B525A16A41F for ; Tue, 13 Feb 2007 16:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 9627E13C4B5 for ; Tue, 13 Feb 2007 16:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l1DGU3N0030530 for ; Tue, 13 Feb 2007 16:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l1DGU33u030529; Tue, 13 Feb 2007 16:30:03 GMT (envelope-from gnats) Resent-Date: Tue, 13 Feb 2007 16:30:03 GMT Resent-Message-Id: <200702131630.l1DGU33u030529@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jeremy Chadwick Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 822AE16A406 for ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/109137: postfix rc.d startup enhancement, postfix_flags X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jeremy Chadwick List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2007 16:30:03 -0000 >Number: 109137 >Category: ports >Synopsis: postfix rc.d startup enhancement, postfix_flags >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Feb 13 16:30:03 GMT 2007 >Closed-Date: >Last-Modified: >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: >Unformatted: