Description of problem: I am using nfs-autofs-automounted homes. When booting up, dovecot fails start up properly, AFAIU, because these users' homes are not yet available: [root@beck ~]# systemctl status dovecot.service dovecot.service - Dovecot IMAP/POP3 email server Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled) Active: active (running) since Wed, 25 Jul 2012 17:51:35 +0200; 3min 40s ago Main PID: 655 (dovecot) CGroup: name=systemd:/system/dovecot.service ├ 655 /usr/sbin/dovecot -F ├ 685 dovecot/anvil ├ 686 dovecot/log └ 691 dovecot/config Jul 25 17:51:35 beck dovecot[655]: master: Dovecot v2.1.8 starting up (cor...d) Jul 25 17:51:35 beck dovecot[655]: master: Warning: /var/ftp/pub is no lon...nt Jul 25 17:51:35 beck dovecot[655]: master: Warning: /misc is no longer mou...nt Jul 25 17:51:35 beck dovecot[655]: master: Warning: /net is no longer moun...nt Jul 25 17:51:35 beck dovecot[655]: master: Warning: /users is no longer mo...nt Jul 25 17:51:35 beck dovecot[655]: master: Warning: /run/user/corsepiu/gvf...nt [root@beck ~]# systemctl restart dovecot.service [root@beck ~]# systemctl status dovecot.service dovecot.service - Dovecot IMAP/POP3 email server Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled) Active: active (running) since Wed, 25 Jul 2012 17:55:42 +0200; 3s ago Main PID: 1723 (dovecot) CGroup: name=systemd:/system/dovecot.service ├ 1723 /usr/sbin/dovecot -F ├ 1727 dovecot/anvil ├ 1728 dovecot/log └ 1730 dovecot/config Jul 25 17:55:42 beck dovecot[1723]: master: Dovecot v2.1.8 starting up (core dumps disabled) Version-Release number of selected component (if applicable): dovecot-2.1.8-1.fc17.x86_64 How reproducible: Always. Manually restarting dovecot resolves this issue. Actual results: After bootup, such users can't access mail. After manually restarting dovecot (cf. above), mail access works again. Expected results: Function. FC16 did not exhibit this behavior.
please try if following helps: create /etc/systemd/system/dovecot.service with content: .include /usr/lib/systemd/system/dovecot.service [Unit] After=autofs.service and reboot. Does it help?
(In reply to comment #1) > Does it help? No, it doesn't. # cat /etc/systemd/system/dovecot.service .include /usr/lib/systemd/system/dovecot.service [Unit] After=autofs.service After rebooting, user "corsepiu" logging-in into xfce via gdm and launching thunderbird: # systemctl status dovecot.service dovecot.service - Dovecot IMAP/POP3 email server Loaded: loaded (/etc/systemd/system/dovecot.service; enabled) Active: active (running) since Fri, 27 Jul 2012 16:32:19 +0200; 5min ago Main PID: 834 (dovecot) CGroup: name=systemd:/system/dovecot.service ├ 834 /usr/sbin/dovecot -F ├ 868 dovecot/anvil └ 869 dovecot/log Jul 27 16:32:19 beck dovecot[834]: master: Dovecot v2.1.8 starting up (core...d) Jul 27 16:32:19 beck dovecot[834]: master: Warning: /run/user/corsepiu/gvfs...nt Jul 27 16:32:45 beck dovecot[869]: imap-login: Login: user=<corsepiu>, meth...o> Jul 27 16:32:45 beck dovecot[869]: imap(corsepiu): Error: chdir(/users/cors...ks Jul 27 16:32:45 beck dovecot[869]: imap(corsepiu): Error: user corsepiu: In...iu Jul 27 16:32:45 beck dovecot[869]: imap(corsepiu): Error: Invalid user sett...n.
OK, I tried to reproduce this. Environment: mkdir /home/auto adduser -d /home/auto/afsuser afsuser passwd afsuser new /etc/auto.home with following line: afsuser -fstype=ext3,loop,rw :/home/disk.img added "/home/auto /etc/auto.home" to /etc/auto.master chkconfig dovecot on chkconfig autofs on dd if=/dev/zero of=/home/disk.img bs=1M count=100 mkfs.ext3 -F /home/disk.img mount /home/disk.img /mnt -oloop mv /home/auto/afsuser /mnt umount /mnt default dovecot configuration, set mail_location=maildir:~/Maildir configure thunderbird to use afsuser@localhost:143 1) Reproduce - force autofs started *after* (note "Before=") dovecot: # cat /etc/systemd/system/dovecot.service .include /usr/lib/systemd/system/dovecot.service [Unit] Before=autofs.service reboot, add enforcing=0 to kernel cmd line start thunderbird -> "Login to server localhost failed." service dovecot status: master: Dovecot v2.1.9 starting up (core dumps disabled) master: Warning: /misc is no longer mounted. See http://wiki2.dovecot.org/Mountpoints master: Warning: /net is no longer mounted. See http://wiki2.dovecot.org/Mountpoints master: Warning: /home/auto is no longer mounted. See http://wiki2.dovecot.org/Mountpoints imap-login: Login: user=<afsuser>, method=PLAIN, rip=::1, lip=::1, mpid=884, secured, session=<u5QeJdzHfAAAAAAAAAAAAAAAAAAAAAAB> imap(afsuser): Error: user afsuser: Initialization failed: Namespace '': Can't create mailbox root dir /home/auto/afsuser/...ount remove imap(afsuser): Error: Invalid user settings. Refer to server log for more information. -> reproducible 2) Try the fix - start dovecot after autofs: # cat /etc/systemd/system/dovecot.service .include /usr/lib/systemd/system/dovecot.service [Unit] After=autofs.service reboot cat /var/log/boot.log: Starting Automounts filesystems on demand... ......... [ OK ] Started Automounts filesystems on demand. Starting Dovecot IMAP/POP3 email server... [ OK ] Started Dovecot IMAP/POP3 email server. so dovecot really is started after autofs thunderbird -> Login failed again service dovecot status: dovecot: master: Dovecot v2.1.9 starting up (core dumps disabled) dovecot: imap-login: Login: user=<afsuser>, method=PLAIN, ... dovecot: imap(afsuser): Error: chdir(/home/auto/afsuser) failed: Too many levels of symbolic links WTF? # cat chdircheck.c #include <unistd.h> #include <stdio.h> #include <errno.h> int main(int argc, char **argv) { int r=chdir("/home/auto/afsuser"); fprintf(stderr,"Return code is: %d, errno=%d : %m\n",r,errno); return r; } gcc chdircheck.c -o /home/chdircheck to /etc/.../dovecot.service added: [Service] ExecStartPre=/home/chdircheck reboot service dovecot status: failed /var/log/messages: chdircheck[608]: Return code is: -1, errno=40 : Too many levels of symbolic links seems there is some problem with autofs. I'll investigate and file a new bug.
> seems there is some problem with autofs. I'll investigate and file a new bug. the bug seems to be in systemd or kernel : bug #851131
That systemd bug won't be fixed in Fedora 17 nor 16, but there should be workaround for that bug. please try if following helps: create /etc/systemd/system/dovecot.service with content: .include /usr/lib/systemd/system/dovecot.service [Unit] After=autofs.service [Service] PrivateTmp=false and reboot. Does it help?
(In reply to comment #5) > That systemd bug won't be fixed in Fedora 17 nor 16, Is anybody surprized, why Fedora is loosing users? I regret, but such kind of regressions, definitely contribute their share to the "great Fedora experience". > but there should be > workaround for that bug. ... > please try if following helps: > create /etc/systemd/system/dovecot.service with content: ... > and reboot. Does it help? Seems so. At least, dovecot appeared working properly after 2 reboots for me. Thanks for you efforts.
Should be fixed in dovecot-2.1.10-2.fc17 I did not use 'After=autofs.service', because for my testing it was not necessary. Only the systemd workaround was required.
dovecot-2.1.10-2.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/dovecot-2.1.10-2.fc17
Package dovecot-2.1.10-2.fc17: * should fix your issue, * was pushed to the Fedora 17 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dovecot-2.1.10-2.fc17' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-17584/dovecot-2.1.10-2.fc17 then log in and leave karma (feedback).
dovecot-2.1.10-2.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.