Bug 177497 - mail/dovecot startup script breaks onestart functionality
Summary: mail/dovecot startup script breaks onestart functionality
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Bryan Drewery
Depends on:
Reported: 2013-03-30 09:00 UTC by Nick
Modified: 2015-03-26 17:48 UTC (History)
2 users (show)

See Also:

[patch] modify dovecot.in rc script to comply to full set of run_rc_command arguments (815 bytes, patch)
2014-07-25 12:12 UTC, fbsd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick 2013-03-30 09:00:00 UTC
mail/dovecot startup script /usr/local/etc/rc.d/dovecot breaks onestart/onestop startup rc functionality.

No script actions will be performed, if dovecot_enable variable doesn't exist in /etc/rc.conf, which cuts out onestart/onestop functionality


Edit the last section of /usr/local/etc/rc.d/dovecot and comment out checkyesno section (not a clean fix, but helps under my usage scenario):

# To start multiple instances of dovecot set dovecot_config to
# a space seperated list of configuration files.
#if checkyesno ${name}_enable; then
	for config in ${dovecot_config}; do
		command_args="-c ${config}"
		base_dir=$(${command} ${command_args} -a | /usr/bin/awk -F '= ' '/^base_dir =/ { print $2 }')
		run_rc_command "$1"
How-To-Repeat: Set dovecot_enable to "NO" or remove the variable completely from /etc/rc.conf
Correct output should be (but it is not):
Usage: /usr/local/etc/rc.d/dovecot [fast|force|one|quiet](start|stop|restart|rcvar|status|poll)
Comment 1 Edwin Groothuis freebsd_committer 2013-03-30 15:00:04 UTC
Class Changed
From-To: maintainer-update->change-request

Fix category (submitter is not maintainer) (via the GNATS Auto Assign 
Comment 2 Edwin Groothuis freebsd_committer 2013-03-30 15:00:05 UTC
Maintainer of mail/dovecot,

Please note that PR ports/177497 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:

Edwin Groothuis via the GNATS Auto Assign Tool
Comment 3 Edwin Groothuis freebsd_committer 2013-03-30 15:00:06 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 John Marino freebsd_committer 2014-06-19 10:25:12 UTC
nick, if you attach a proper patch, I'll commit it.
I'm going to reset the maintainer after 6 consecutive timeouts.
Comment 5 fbsd 2014-07-24 11:11:22 UTC
This is listed as Resolved FIXED, but it still isn't with version 2.2.13_2. Also, is there any real world requirement to start multiple instances of dovecot? Shouldn't that be done with jails?
Comment 6 John Marino freebsd_committer 2014-07-24 11:20:23 UTC
I'm not sure why it got set to fixed, probably an accident.
Comment 7 fbsd 2014-07-25 12:12:31 UTC
Created attachment 144964 [details]
[patch] modify dovecot.in rc script to comply to full set of run_rc_command arguments

I'm not sure the patch is properly done (relative dirs?) because it's my first submission of a port patch, but basically it's a change suggested by the OP. The patch is for files/dovecot.in rc script.

Removing the explicit checkyesno check apparently makes the script behave properly. Eg. 'service dovecot start' will fail if dovecot is not enabled in rc.conf, and will start properly if onestart is used.
Comment 8 fbsd 2014-10-30 10:41:18 UTC
I see now that the original report says mail/dovecot. My comment and patch was for mail/dovecot2. Sorry, my omission.

But I see now, from the FreeBSD GitHub Ports repo that the problem has been fixed? BOTH mail/dovecot and mail/dovecot2 are patched as proposed. I just updated my mail/dovecot2 and the rc script included is the patched one.
Comment 9 Bryan Drewery freebsd_committer 2015-03-26 17:48:05 UTC
Yes I did fix this when I closed. The dfilter script failed to add a comment.

r359890 | bdrewery | 2014-06-30 12:33:21 -0500 (Mon, 30 Jun 2014) | 10 lines

- Take maintainership
- Attempt to limit portscout to version 1.2
- Fix rc script for one* commands [1]

Not bumping PORTREVISION as the installed version doesn't change, should
not affect dependent ports.

PR:             177497 [1]
Submitted by:   nick@3wh.net [1]