From nobody Tue Jun 14 17:43:19 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3E3BE84330E; Tue, 14 Jun 2022 17:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LMwlD17FQz3jCw; Tue, 14 Jun 2022 17:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655228600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KX9yA6cy5hsB7ESOZeaBJwj1GmbIAnLc3a4levLwmNk=; b=DxILlu20O5ZB2nFrB2e2o0iYMHVI/0mq/ai1wglFLqpAaJUPytEoIt79UdZSLOj+64DP3k OK/BCmyeQToR/uTd6L6ncxgQ52JTKUnc1vVJZu356uMhaEF45b3L1aGvpa6ZHsvrzsFOFW WwynEO+Gso3vD8EJ/i3tSusSYv8k6RnTX92BYbWFJyuuyd/CnBS+XQlU8op31KjZr+fphT MysGnJLIGYP5JeDUN8k3ArEPQFRHGaZ9AxKKp78Jnfa/rk3fmAE3M0Sr0AWT1PMz5RQMKa zfSpJ3pja/we9rCnROSPEmDHziThQn7rsuoq658Q81aMDMemyOpGf4ZL+1JU4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0700B657C; Tue, 14 Jun 2022 17:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25EHhJ2b019677; Tue, 14 Jun 2022 17:43:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25EHhJ9s019676; Tue, 14 Jun 2022 17:43:19 GMT (envelope-from git) Date: Tue, 14 Jun 2022 17:43:19 GMT Message-Id: <202206141743.25EHhJ9s019676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1442fed7e25e - main - rc.d/ntpd: Restart ntpd when resuming from sleep. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1442fed7e25e9856464a0b0ce522ffc8cb473593 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655228600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KX9yA6cy5hsB7ESOZeaBJwj1GmbIAnLc3a4levLwmNk=; b=yNbttBunAdq1SJ4AqCbP22R8TA392pqX6zzDrTGKPCib4mxVJn4zFus2b5FEylG9tgRpfE HSe5zg3H44zrB36litNmcbSOqmEYLegem8h+BngdusKmM5aGXOmxGveTpVhrJEs0RiXG+q mzGYTwDTQz1urhehInF7I7uGu3u+Gc4P5TaoAW53A0PDlCy3pi3Kgn2mqNTZUNePN0cJXK 9t0vJXRuwiGiktU62Qvaz/JVpq4+0tu5xg5i0QxoU2uTN2mEX0Ws7/kCxr8gpLfekpT5Ys ZSyL9i5sDRZBphlqvKBptnSn5oM1TRYZkOgfu0kPwwr6MSyiMELpZPJYaHG/wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655228600; a=rsa-sha256; cv=none; b=Fl6ncMkObyctteN0GIfpHPS0cWFgx0mzPe/itXXQ8SqOpl/n/6XCYsQpv1a13XtfOvAGYO pw4LGWt5NtZOfl5rFySM6iEMWE0OaLEPbjIVraYapNCAXaWB/dfI8kaC1KtuvH+6n/Y8J5 7twyyiuWOLly9JPBX9FlJ4ZwXm9wx12Gr37HJ/2fEJIaOtGAHvFkUf8O3Lky7a7WwvYn0W REkdHZGiEnsGzou91x0QoN69m+iCGcmCsGVRXo5A+E9nNiOc35AiVpsFVpGY92Se92p5Ia QGD/Pbi8JNH+rouE9iweuzsbllCfOaHT7/mE+ZL7SBN7LGTumRtwq+NeQYhD/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1442fed7e25e9856464a0b0ce522ffc8cb473593 commit 1442fed7e25e9856464a0b0ce522ffc8cb473593 Author: John Baldwin AuthorDate: 2022-06-14 17:42:51 +0000 Commit: John Baldwin CommitDate: 2022-06-14 17:42:51 +0000 rc.d/ntpd: Restart ntpd when resuming from sleep. ntpd does not always gracefully handle clock steps during resume. This is probably most useful in conjunction with ntpd_sync_on_start=YES which will work around any clock skew while suspended. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D35479 --- libexec/rc/rc.d/ntpd | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd index c1d2f52a01b7..7c7879583185 100755 --- a/libexec/rc/rc.d/ntpd +++ b/libexec/rc/rc.d/ntpd @@ -6,7 +6,7 @@ # PROVIDE: ntpd # REQUIRE: DAEMON ntpdate FILESYSTEMS devfs # BEFORE: LOGIN -# KEYWORD: nojail shutdown +# KEYWORD: nojail resume shutdown . /etc/rc.subr @@ -14,9 +14,10 @@ name="ntpd" desc="Network Time Protocol daemon" rcvar="ntpd_enable" command="/usr/sbin/${name}" -extra_commands="fetch needfetch" +extra_commands="fetch needfetch resume" fetch_cmd="ntpd_fetch_leapfile" needfetch_cmd="ntpd_needfetch_leapfile" +resume_cmd="ntpd_resume" start_precmd="ntpd_precmd" _ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" @@ -239,4 +240,9 @@ ntpd_fetch_leapfile() { fi } +ntpd_resume() +{ + run_rc_command restart +} + run_rc_command "$1"