Bug 20065

Summary: dovecot.service: PID file /run/dovecot/master.pid not readable (yet?) after start:
Product: Mageia Reporter: Bit Twister <bittwister2>
Component: RPM PackagesAssignee: Marc Krämer <mageia>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: mageia, mageia, marja11
Version: CauldronKeywords: 6sta2
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: dovecot-2.2.29.1-1.mga6.src.rpm CVE:
Status comment:

Description Bit Twister 2017-01-03 19:30:03 CET
Description of problem:  6_s2: 

dovecot.service: PID file /run/dovecot/master.pid not readable (yet?) after start: No such file or directory



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. install updates; reboot
2. journalctl -b | grep dovecot | grep PID
3.
Comment 1 Marja Van Waes 2017-01-03 21:50:20 CET
Assigning to all packagers collectively, since there is no registered maintainer for this package.

CC: (none) => marja11
Assignee: bugsquad => pkg-bugs

Bit Twister 2017-01-23 21:42:54 CET

Status comment: (none) => 6_s2
Summary: 6_s2: dovecot.service: PID file /run/dovecot/master.pid not readable (yet?) after start: => dovecot.service: PID file /run/dovecot/master.pid not readable (yet?) after start:

Bit Twister 2017-01-31 18:44:03 CET

Keywords: (none) => 6sta2
Status comment: 6_s2 => (none)

Bit Twister 2017-03-04 23:18:09 CET

Source RPM: dovecot-2.2.27-2.mga6.src.rpm => dovecot-2.2.28-1.mga6.src.rpm

Bit Twister 2017-03-20 07:19:58 CET

Source RPM: dovecot-2.2.28-1.mga6.src.rpm => dovecot-2.2.28-2.mga6.src.rpm

Bit Twister 2017-04-18 09:47:52 CEST

Source RPM: dovecot-2.2.28-2.mga6.src.rpm => dovecot-2.2.29.1-1.mga6.src.rpm

Marc Krämer 2018-01-02 14:48:14 CET

Assignee: pkg-bugs => mageia
CC: (none) => mageia

Comment 2 Marc Krämer 2018-01-02 14:50:04 CET
I've installed version 2.2.32 from cauldron. I don't see any issues here.
dovecot 2.2.29 from current release just works fine, as I use it in production environment.
Comment 3 Bit Twister 2018-01-02 16:28:54 CET
(In reply to Marc Krämer from comment #2)
> I've installed version 2.2.32 from cauldron. I don't see any issues here.
> dovecot 2.2.29 from current release just works fine, as I use it in
> production environment.

Does test procedure step 2 show the error?

If so, I maintain the bug is still valid.
In my opinion, there should be no "No such file or directory" errors in the journal regardless how well the service runs.
Comment 4 Marc Krämer 2018-01-02 16:50:05 CET
nope, it does not.

I have not seen this error on mga6 either with a configured production environment.

Are you sure, the configuration is valid, so the master is able to startup?

I've tested this on cauldron with no config, and I don't get this error on startup.
Comment 5 Bit Twister 2018-01-02 17:18:22 CET
Well, I see the message on mga6 and cauldron and I am able to read mail with thunderbird.

$ systemctl status dovecot
● dovecot.service - Dovecot IMAP/POP3 email server
   Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2017-12-30 15:37:05 CST; 2 days ago
     Docs: man:dovecot(1)
           http://wiki2.dovecot.org/
 Main PID: 1146 (dovecot)
   CGroup: /system.slice/dovecot.service
           ├─1146 /usr/sbin/dovecot
           ├─1147 dovecot/anvil
           ├─1148 dovecot/log
           ├─1150 dovecot/config
           ├─8243 dovecot/imap-login
           ├─8244 dovecot/ssl-params
           └─8254 dovecot/imap

Dec 30 15:37:01 wb.home.test systemd[1]: Starting Dovecot IMAP/POP3 email server...
Dec 30 15:37:05 wb.home.test systemd[1]: dovecot.service: PID file /run/dovecot/master.pid not readable (yet?) after start: No such 
Dec 30 15:37:05 wb.home.test systemd[1]: Started Dovecot IMAP/POP3 email server.


My changes:

# cat /etc/dovecot/conf.d/xx__dovecot.conf
# Created by /local/bin/dovecot_changes Sat 28 Oct 21:55 2017
listen = *
log_path = /var/log/dovecot/errors.log
info_log_path = /var/log/dovecot/info.log
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u
mail_privileged_group = mail
#************** end /etc/dovecot/conf.d/xx__dovecot.conf *********

$ cat /etc/logrotate.d/dovecot
 /var/log/dovecot/*.log {
    weekly
    notifempty
    missingok
    compress
    postrotate
        /usr/bin/killall -HUP dovecot
    endscript
}
Comment 6 Marc Krämer 2018-01-02 18:35:02 CET
Hmm, I've reproduced this once. Looks like a racing condition. 
As you can see, systems starts dovecot, then checks for the pid while the forking process has not created the master. This is more related to systemd.
I haven't found a solution for this yet, if you search for this, you find many systemd services to fail in first instance, as the main-process exits, before the pid of the forked process is created.

You can see, after the startup the PID file is created and is recognized by systemd afterwards.

As this behavior is documented by systemd, only dovecot can change it's forking behavior. I assume systemd will not add any extra parameter to delay watching for the pid file.
Comment 7 Raphael Gertz 2018-09-12 02:55:09 CEST
Seems fixed in mga7/cauldron, closing for now, reopen if it is still the case.

Resolution: (none) => FIXED
Status: NEW => RESOLVED
CC: (none) => mageia