Bug 205761 - mail/dovecot2: rc script not working when config missing
Summary: mail/dovecot2: rc script not working when config missing
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Adam Weinberger
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-12-31 18:22 UTC by Christian Schwarz
Modified: 2016-01-28 01:33 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (adamw)
koobs: merge-quarterly?


Attachments
Patch for the port. (402 bytes, patch)
2015-12-31 18:22 UTC, Christian Schwarz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Schwarz 2015-12-31 18:22:47 UTC
Created attachment 164906 [details]
Patch for the port.

The dovecot2 ports does not ship with a default config (bug #198792).

The dovecot2 port also brings the ability to run multiple instances of dovecot2 at once.

ports r378311 changed the behavior of the rc-script to only `run_rc_command` for those config files listed in the rcvar that are actually present.

However, this leads to the following situation:
- User installs mail/dovecot2
- User / Automation tool runs `service dovecot <command>`, e.g. command=rcvar
- Script produces no output because `run_rc_command` is not run because no config file exists.

While easily resolvable by first deploying the configuration and then running `service...`, the script should still work.

I therefore propose the patch I attached to this report.
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2016-01-03 04:05:09 UTC
Sorry about the delay in responding to this PR. It'll be another day or two before I can play with it, but this patch sounds like a great idea.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-01-05 20:59:12 UTC
A commit references this bug:

Author: adamw
Date: Tue Jan  5 20:59:02 UTC 2016
New revision: 405316
URL: https://svnweb.freebsd.org/changeset/ports/405316

Log:
  Execute run_rc_command even if the config file doesn't exist. Previously,
  until you followed the instructions in pkg-message, the config file didn't
  exist and rc.d/dovecot would just silently exit.

  While here, also spit out a message reminding you to create the config
  files if necessary.

  PR:		205761
  Submitted by:	me@cschwarz.com

Changes:
  head/mail/dovecot2/Makefile
  head/mail/dovecot2/files/dovecot.in
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2016-01-05 21:00:11 UTC
Committed, along with a message stating the config file doesn't exist, and a pointer to the instructions to create it.

Thanks for this!
Comment 4 Christian Schwarz 2016-01-17 23:15:40 UTC
(In reply to Adam Weinberger from comment #3)

I would propose merging the change back into the quarterly 2016Q1 branch.

The specific revision to be merged into 2016Q1: ports r405316
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-18 01:46:47 UTC
Re-open for MFH request (comment 4)
Comment 6 Adam Weinberger freebsd_committer freebsd_triage 2016-01-28 01:33:34 UTC
MFH completed in r407391.
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-01-28 01:33:38 UTC
A commit references this bug:

Author: adamw
Date: Thu Jan 28 01:32:36 UTC 2016
New revision: 407391
URL: https://svnweb.freebsd.org/changeset/ports/407391

Log:
  MFH: r405316

  Execute run_rc_command even if the config file doesn't exist. Previously,
  until you followed the instructions in pkg-message, the config file didn't
  exist and rc.d/dovecot would just silently exit.

  While here, also spit out a message reminding you to create the config
  files if necessary.

  PR:		205761
  Submitted by:	me@cschwarz.com

  Approved by:	ports-secteam (feld)

Changes:
_U  branches/2016Q1/
  branches/2016Q1/mail/dovecot2/Makefile
  branches/2016Q1/mail/dovecot2/files/dovecot.in