Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  7 Nov 2007 11:37:54 -0800 (PST)
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/117894: dovecot 
Message-ID:  <20071107193937.688931CC0A4@mx01.sc1.parodius.com>
Resent-Message-ID: <200711072010.lA7KA2va064228@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         117894
>Category:       ports
>Synopsis:       dovecot
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 07 20:10:02 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy Chadwick
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD eos.sc1.parodius.com 6.2-STABLE FreeBSD 6.2-STABLE #0: Mon Jun 25 13:30:53 PDT 2007 root@eos.sc1.parodius.com:/usr/obj/usr/src/sys/EOS i386
>Description:
	I'm marking this as serious/low because it can cause dovecot to
	not start on boot-up.

	Our RELENG_6 machine panic'd today.  We run ntpd on the machine,
	as well as use ntpd_sync_on_start="yes" (to ensure the clock is
	synced upon startup, then ntpd is run), so the clock is kept in
	sync very often, and has never strayed.

	Once the machine came back up, the rc.d script said dovecot was
	starting, but it did not.  I found the following message in our
	dovecot.log:

Nov 07 10:56:18 Info: Dovecot v1.0.3 starting up
Nov 07 10:51:18 Fatal: Time just moved backwards by 304 seconds. This might cause a lot of problems, so I'll just kill myself now. http://wiki.dovecot.org/TimeMovedBackwards

	I found this about 20 minutes after the fact.  I then restarted
	dovecot manually, and the daemon started up fine.

	It appears to me that what's happening is an interesting race
	condition where ntpdate has run (via ntpd_sync_on_start="yes"),
	but the system clock hasn't been updated yet.  During the time
	ntpdate is running, dovecot starts.  Within a second or so,
	ntpdate updates/syncs the clock, and dovecot immediately
	notices.

	When the clock moves backwards, dovecot will bail out.

>How-To-Repeat:
	See above.  Should be easy to repro.
>Fix:
	I think what we need is to change the REQUIRE line of rc.d/dovecot
	to the following:

	# REQUIRE: LOGIN ntpdate

	What needs to happen is that dovecot should ONLY START after
	ntpdate has been run and has completely updated the clock.  I
	assume "REQUIRE: ntpdate" will do this, but I'm not completely
	sure, because I'm not 100% familiar with this aspect of the rc(8)
	system...
	
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071107193937.688931CC0A4>