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
Created attachment 227665 [details, diff] Patch to correctly determine base_dir
Created attachment 227667 [details, diff] Slightly more robust parsing than previous patch
Confirmed. Will release a new dovecot with revized init script. Thank you for the report.
Should be fixed with beta5 now