Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Feb 2015 17:16:13 +0000 (UTC)
From:      Adam Weinberger <adamw@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r378311 - in head/mail/dovecot2: . files
Message-ID:  <201502021716.t12HGDue078742@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adamw
Date: Mon Feb  2 17:16:12 2015
New Revision: 378311
URL: https://svnweb.freebsd.org/changeset/ports/378311
QAT: https://qat.redports.org/buildarchive/r378311/

Log:
  rc.d/dovecot allows for multiple concurrent dovecot setups, but in doing
  so runs the dovecot binary against each provided configuration file to
  obtain configuration data. When the configuration file doesn't exist, it
  says:
  	doveconf: Fatal: open(/im_not_here) failed: No such file or directory
  
  Mistyping the conf file locations when doing multiple instances deserves
  an error message. The real issue here is that in order to set up
  dovecot, you have to actually copy files over from ${EXAMPLESDIR}. The
  default configuration file intentionally does not exist in a clean
  installation. So everybody who installs the dovecot2 port and does not
  configure it will receive that message at every boot.
  
  Fix it with a patch from pi that makes sure the conf file exists before
  trying to do stuff with it.
  
  PORTREVISION bump.
  
  PR:		197275
  Submitted by:	pi

Modified:
  head/mail/dovecot2/Makefile
  head/mail/dovecot2/files/dovecot.in

Modified: head/mail/dovecot2/Makefile
==============================================================================
--- head/mail/dovecot2/Makefile	Mon Feb  2 16:42:13 2015	(r378310)
+++ head/mail/dovecot2/Makefile	Mon Feb  2 17:16:12 2015	(r378311)
@@ -3,7 +3,7 @@
 
 PORTNAME=	dovecot
 PORTVERSION=	2.2.15
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	mail ipv6
 MASTER_SITES=	http://www.dovecot.org/releases/${PORTVERSION:R}/
 PKGNAMESUFFIX=	2

Modified: head/mail/dovecot2/files/dovecot.in
==============================================================================
--- head/mail/dovecot2/files/dovecot.in	Mon Feb  2 16:42:13 2015	(r378310)
+++ head/mail/dovecot2/files/dovecot.in	Mon Feb  2 17:16:12 2015	(r378311)
@@ -52,7 +52,9 @@ restart_cmd()
 for config in ${dovecot_config}; do
 	required_files="${config}"
 	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"
+	if [ -f ${config} ]; then
+		base_dir=$(${command} ${command_args} -a | /usr/bin/awk -F '= ' '/^base_dir =/ { print $2 }')
+		pidfile="${base_dir}/master.pid"
+		run_rc_command "$1"
+	fi
 done



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502021716.t12HGDue078742>