From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Nov 7 20:10:03 2007 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64AAD16A420 for ; Wed, 7 Nov 2007 20:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4A03013C49D for ; Wed, 7 Nov 2007 20:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lA7KA2YU064229 for ; Wed, 7 Nov 2007 20:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lA7KA2va064228; Wed, 7 Nov 2007 20:10:02 GMT (envelope-from gnats) Resent-Date: Wed, 7 Nov 2007 20:10:02 GMT Resent-Message-Id: <200711072010.lA7KA2va064228@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jeremy Chadwick Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FE7B16A417 for ; Wed, 7 Nov 2007 20:04:43 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 6557E13C481 for ; Wed, 7 Nov 2007 20:04:43 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 688931CC0A4; Wed, 7 Nov 2007 11:37:54 -0800 (PST) Message-Id: <20071107193937.688931CC0A4@mx01.sc1.parodius.com> Date: Wed, 7 Nov 2007 11:37:54 -0800 (PST) From: Jeremy Chadwick To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/117894: dovecot X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jeremy Chadwick List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2007 20:10:03 -0000 >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: