Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 397619 - net-mail/dovecot - service fails to stop because of wrong base_dir handling
Summary: net-mail/dovecot - service fails to stop because of wrong base_dir handling
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Eray Aslan
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-01-04 11:22 UTC by Matthias Weiss
Modified: 2012-01-05 11:03 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Weiss 2012-01-04 11:22:06 UTC
Starting dovecot (version 2.0.16) with 

rc_service dovecot start

works as expected. Stopping dovecot with

rc_service dovecot stop

generates an error:

dovecot         | * Caching service dependencies ...                      [ ok ]
dovecot         | * Stopping dovecot ...
dovecot         | * start-stop-daemon: fopen `base_dir = /var/run/dovecot/master.pid': No such file or directory                                   [ ok ]

I have the following base_dir entry in /etc/dovecot/dovecot.conf that triggers the error:

base_dir = /var/run/dovecot

Reproducible: Always

Steps to Reproduce:
1.Have a line like base_dir = /var/run/dovecot in your /etc/dovecot/dovecot.conf
2.Start dovecot with rc_service dovecot start
3.Stop dovecot with rc_service dovecot stop
Actual Results:  
dovecot         | * Caching service dependencies ...                      [ ok ]
dovecot         | * Stopping dovecot ...
dovecot         | * start-stop-daemon: fopen `base_dir = /var/run/dovecot/master.pid': No such file or directory                                   [ ok ]


Expected Results:  
dovecot         | * Stopping dovecot ...                                                [ ok ]

quick patch to fix /etc/init.d/dovecot:

26c26
<       DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} -a | sed -ne '/^base_dir/{s#^base_dir[[:space:]]=[[:space:]]*\(.*[^/]\)/\?$#\1#;p}')
---
>       DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} -a | sed -ne '/^base_dir/{s#^base_dir:[[:space:]]*\(.*[^/]\)/\?$#\1#;p}')
Comment 1 Matthias Weiss 2012-01-04 11:32:28 UTC
A small correction to the patch:

26c26
<       DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} -a | sed -ne '/^base_dir/{s#^base_dir[[:space:]]*=[[:space:]]*\(.*[^/]\)/\?$#\1#;p}')
---
>       DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c ${DOVECOT_CONF} -a | sed -ne '/^base_dir/{s#^base_dir:[[:space:]]*\(.*[^/]\)/\?$#\1#;p}')
Comment 2 Eray Aslan gentoo-dev 2012-01-04 18:44:05 UTC
Ugh, that's an old old init script and was removed from the tree in 2009.  Why are you still using it?  Please check your config if emerging does not prompt you for an upgraded init script.

Closing as invalid.
Comment 3 Matthias Weiss 2012-01-05 11:03:31 UTC
(In reply to comment #2)
> Ugh, that's an old old init script and was removed from the tree in 2009.  Why
> are you still using it?  Please check your config if emerging does not prompt
> you for an upgraded init script.

Very interesting, I installed dovecot end of December 2011. So probably there were some remnants of an old installation. Sorry for the inconvenience.