Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 315111 - net-mail/dovecot-2.0_beta4 init script cannot stop (or restart) service
Summary: net-mail/dovecot-2.0_beta4 init script cannot stop (or restart) service
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-13 20:57 UTC by Felix Leimbach
Modified: 2010-05-19 14:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to correctly determine base_dir (dovecot-init.patch,692 bytes, patch)
2010-04-13 20:58 UTC, Felix Leimbach
Details | Diff
Slightly more robust parsing than previous patch (dovecot-init-v2.patch,694 bytes, patch)
2010-04-13 21:02 UTC, Felix Leimbach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Leimbach 2010-04-13 20:57:11 UTC
Starting dovecot for the first time all is fine.
Then, when stopping or restarting the init script fails to determine the base_dir correctly:

# /etc/init.d/dovecot restart
* Stopping dovecot...
* start-stop-daemon: fopen `base_dir = /var/run/dovecot/master.pid': No such file or directory                                                         [ ok ]
* Starting dovecot...
Fatal: Dovecot is already running with PID 9430 (read from /var/run/dovecot/master.pid)
* start-stop-daemon: failed to start `/usr/sbin/dovecot'                                                                                               [ !! ]
* ERROR: dovecot failed to start

The error is that the basedir is set to "base_dir = /var/run/dovecot/master.pid" instead of the correct "/var/run/dovecot/master.pid".

This is caused by line 26 of the init script:
DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} -a | sed -ne '/^base_dir/{s#^base_dir:[[:space:]]*\(.*[^/]\)/\?$#\1#;p}')

Attached patch fixes the problem by adjusting the sed expression.

Reproducible: Always

Steps to Reproduce:
1. start dovecot: /etc/init.d/dovecot start
2. restart dovecot: /etc/init.d/dovecot restart
Comment 1 Felix Leimbach 2010-04-13 20:58:03 UTC
Created attachment 227665 [details, diff]
Patch to correctly determine base_dir
Comment 2 Felix Leimbach 2010-04-13 21:02:22 UTC
Created attachment 227667 [details, diff]
Slightly more robust parsing than previous patch
Comment 3 Eray Aslan gentoo-dev 2010-04-15 07:10:50 UTC
Confirmed.  Will release a new dovecot with revized init script.  Thank you for the report.
Comment 4 Patrick Lauer gentoo-dev 2010-05-19 14:03:24 UTC
Should be fixed with beta5 now