From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Nov 29 18:20:03 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A051E106564A for ; Sat, 29 Nov 2008 18:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 889518FC14 for ; Sat, 29 Nov 2008 18:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mATIK3UB060006 for ; Sat, 29 Nov 2008 18:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mATIK3gG060005; Sat, 29 Nov 2008 18:20:03 GMT (envelope-from gnats) Date: Sat, 29 Nov 2008 18:20:03 GMT Message-Id: <200811291820.mATIK3gG060005@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Darren Pilgrim Cc: Subject: Re: ports/129274: [mail/dovecot] Patch to dovecot.sh.in to facilitate multi-instance configurations X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Darren Pilgrim List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2008 18:20:03 -0000 The following reply was made to PR ports/129274; it has been noted by GNATS. From: Darren Pilgrim To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/129274: [mail/dovecot] Patch to dovecot.sh.in to facilitate multi-instance configurations Date: Sat, 29 Nov 2008 09:58:21 -0800 This is a multi-part message in MIME format. --------------070909040508090908030304 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I missed a %%PREFIX%% in the previous diff. A revised diff is attached. --------------070909040508090908030304 Content-Type: text/plain; name="dovecot.sh.in.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dovecot.sh.in.diff" --- dovecot.sh.in 2008-11-28 10:49:23.000000000 -0800 +++ dovecot.sh.in.new 2008-11-29 09:55:10.000000000 -0800 @@ -20,23 +20,27 @@ # read configuration and set defaults load_rc_config ${name} : ${dovecot_enable:="NO"} +: ${dovecot_config:="%%PREFIX%%/etc/dovecot.conf"} +: ${dovecot_extra_configs:=""} command="%%PREFIX%%/sbin/${name}" -command_args="-c ${dovecot_config:="%%PREFIX%%/etc/${name}.conf"}" -required_files="${dovecot_config}" +required_files="${dovecot_config} ${dovecot_extra_configs}" +restart_cmd="restart_cmd" start_precmd="start_precmd" stop_postcmd="stop_postcmd" extra_commands="restart" -base_dir=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^base_dir:/ { print $2 }') -login_dir=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^login_dir:/ { print $2 }') -login_user=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^login_user:/ { print $2 }') - -pidfile="${base_dir}/master.pid" - +restart_cmd() +{ # Overriding this makes rc.subr run this once for each instance + run_rc_command stop + run_rc_command start +} + start_precmd() { # Ensure runtime directories exist with correct permissions - local gid + local login_dir login_user gid + login_dir=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^login_dir:/ { print $2 }') + login_user=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^login_user:/ { print $2 }') gid=$(/usr/sbin/pw usershow -n "${login_user}" 2>/dev/null | /usr/bin/cut -d: -f4) /usr/bin/install -o root -g wheel -m 0755 -d ${base_dir} /usr/bin/install -o root -g ${gid} -m 0750 -d ${login_dir} @@ -47,4 +51,9 @@ rm -rf ${base_dir} 2>/dev/null } -run_rc_command "$1" +for config in ${dovecot_config} ${dovecot_extra_configs}; do + command_args="-c ${config}" + base_dir=$(${command} ${command_args} -a | /usr/bin/awk -F ': ' '/^base_dir:/ { print $2 }') + pidfile="${base_dir}/master.pid" + run_rc_command "$1" +done --------------070909040508090908030304--