Bug 232785

Summary: mail/dovecot: does not identify config error and presents bad error message
Product: Ports & Packages Reporter: Phillip R. Jaenke <prj>
Component: Individual Port(s)Assignee: Larry Rosenman <ler>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (ler)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
mail_dovecot_files_dovecot.in.patch none

Description Phillip R. Jaenke 2018-10-29 16:11:02 UTC
Created attachment 198737 [details]
mail_dovecot_files_dovecot.in.patch

If dovecot fails the configuration check, it will attempt to start anyways, and present a misleading error message in the process.

Example of a config error attempting to start with the bad error message:

 root@draco /usr/local/etc/rc.d # ./dovecot onestart

usage: install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               [-B suffix] [-l linkflags] [-N dbdir]
               file1 file2
       install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               [-B suffix] [-l linkflags] [-N dbdir]
               file1 ... fileN directory
       install -dU [-vU] [-g group] [-m mode] [-N dbdir] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               directory ...
./dovecot: WARNING: failed precmd routine for dovecot

Attached patch updates rc.d to perform the configuration check before attempting to start, bails out if configuration check fails, and presents the user with the exact error message from dovecot.
Comment 1 Larry Rosenman freebsd_committer freebsd_triage 2018-10-29 23:28:41 UTC
Committed, Thanks.
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-10-29 23:29:12 UTC
A commit references this bug:

Author: ler
Date: Mon Oct 29 23:28:27 UTC 2018
New revision: 483437
URL: https://svnweb.freebsd.org/changeset/ports/483437

Log:
  mail/dovecot: give better error message(s) when there are configuration errors.

  PR:		232785
  Submitted by:	prj@rootwyrm.com

Changes:
  head/mail/dovecot/Makefile
  head/mail/dovecot/files/dovecot.in