From nobody Wed Mar 27 12:09:43 2024 X-Original-To: freebsd-arm@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 4V4QTW2ZRwz5FM4v for ; Wed, 27 Mar 2024 12:09:51 +0000 (UTC) (envelope-from SRS0=lh/3=LB=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4V4QTW01vrz4lbK; Wed, 27 Mar 2024 12:09:50 +0000 (UTC) (envelope-from SRS0=lh/3=LB=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; none Date: Wed, 27 Mar 2024 13:09:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1711541383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bKcJaGMzruqBDFNVnBIJPqVCI5fE3pn23s+K1TZLbPo=; b=pcGGKJmhew+T7V5qNoSV5AuKEBVI/wZCYw8YfMRZBR2U80gxrirRfqExJuRAurIFCws5eC akuuaNMGBCWXn17n+25Jdti+5uP+9eGo2Oz/VS0RtDXcCiY2YHAJwO9CABwaOGjoSjVzta rZlrnQJy6udvhoGuhEsAP7bvHohpPYr3OFI6KaaYZt5mn2GMxUpAZAFj6rnpOkjTaN66ul 04hphoNhPAmDbXFDUCRgp4bKpoRvNlaNZglhwr41Z9Qd+4Vz4gVeategM4lY3n/gEdR/k8 vzCTAUaQsgDXWQ5eGPsB3FACdAHY8gzlHfpJjxxJJoT8/kufl93/o6OHg4zGbQ== From: Ronald Klop To: Nuno Teixeira Cc: FreeBSD ARM List Message-ID: <352178670.7273.1711541383408@localhost> In-Reply-To: References: Subject: Re: local/etc/rc.d service that runs before date being set by ntpd List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7272_1355329237.1711541383387" X-Mailer: Realworks (695.8) Importance: Normal X-Priority: 3 (Normal) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL] X-Rspamd-Queue-Id: 4V4QTW01vrz4lbK ------=_Part_7272_1355329237.1711541383387 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Van: Nuno Teixeira Datum: woensdag, 27 maart 2024 10:55 Aan: FreeBSD ARM List Onderwerp: local/etc/rc.d service that runs before date being set by ntpd > > Hello all, > > On rpi4 I use a service dns/noip and found that it don't get actual date from ntpd: > > /var/log/daemon.log (today) after boot > --- > > Mar 27 09:09:40 rpi4 dhclient[1183]: DHCPREQUEST on genet0 to 192.168.1.1 port 67 > Mar 27 09:09:40 rpi4 dhclient[1183]: DHCPACK from 192.168.1.1 > Mar 27 09:09:40 rpi4 dhclient[1183]: bound to 192.168.1.66 -- renewal in 1800 seconds. > Jan 1 01:00:34 rpi4 noip2[1617]: v2.1.9 daemon started with NAT enabled > Jan 1 01:00:35 rpi4 noip2[1617]: freebsdrpi4.hopto.org was already set to 149.90.156.215. > > Mar 27 09:26:13 rpi4 noip2[1617]: v2.1.9 daemon ended. > Mar 27 09:26:13 rpi4 noip2[1887]: v2.1.9 daemon started with NAT enabled > Mar 27 09:26:14 rpi4 noip2[1887]: freebsdrpi4.hopto.org was already set to 149.90.156.215. > --- > rcconf: > ntpd_enable="YES" > ntpd_sync_on_start="YES" > > Checking `rcorder /etc/rc.d/* /usr/local/etc/rcd/*` have correct order (?): > > > /etc/rc.d/ntpdate > ... > /etc/rc.d/sdpd > /etc/rc.d/rarpd > /etc/rc.d/powerd > /etc/rc.d/ntpd > /etc/rc.d/nscd > /usr/local/etc/rc.d/dbus > /usr/local/etc/rc.d/git_daemon > /usr/local/etc/rc.d/noip > /etc/rc.d/rfcomm_pppd_server > /etc/rc.d/mountd > /etc/rc.d/swaplate > ... > Strange that noip doesn't get correct date at boot time. > > Do I missing something? > > Thanks! > > -- > Nuno Teixeira > FreeBSD Committer (ports) Hi, In my rcorder output noip2 comes before ntpd. But I have in rc.conf: ntpdate_enable="YES" ntpd_enable="YES" ntpdate is run more early in the rcorder. I don't know about ntpd_sync_on_start and if that influences the rcorder. I think it is just an option to ntpd. Please try to add ntpdate_enable="YES". BTW: if you run ZFS-on-boot on RPI you can use sysutils/fakertc to get a bit better time at boot. In UFS the time is stored on disk on unmount/shutdown which is used to set the time on startup. ZFS does not have this feature. Fakertc mimics this as good as it can which can help to have a "decent" time to make TLS certificates, etc. valid on boot. Regards, Ronald. ------=_Part_7272_1355329237.1711541383387 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

Van: Nuno Teixeira <eduardo@freebsd.org>
Datum: woensdag, 27 maart 2024 10:55
Aan: FreeBSD ARM List <freebsd-arm@freebsd.org>
Onderwerp: local/etc/rc.d service that runs before date being set by ntpd

Hello all,

On rpi4 I use a service dns/noip and found that it don't get actual date from ntpd:
 
/var/log/daemon.log (today) after boot
---
<snip>
Mar 27 09:09:40 rpi4 dhclient[1183]: DHCPREQUEST on genet0 to 192.168.1.1 port 67
Mar 27 09:09:40 rpi4 dhclient[1183]: DHCPACK from 192.168.1.1
Mar 27 09:09:40 rpi4 dhclient[1183]: bound to 192.168.1.66 -- renewal in 1800 seconds.
Jan  1 01:00:34 rpi4 noip2[1617]: v2.1.9 daemon started with NAT enabled
Jan  1 01:00:35 rpi4 noip2[1617]: freebsdrpi4.hopto.org was already set to 149.90.156.215.
<service noip restart>
Mar 27 09:26:13 rpi4 noip2[1617]: v2.1.9 daemon ended.
Mar 27 09:26:13 rpi4 noip2[1887]: v2.1.9 daemon started with NAT enabled
Mar 27 09:26:14 rpi4 noip2[1887]: freebsdrpi4.hopto.org was already set to 149.90.156.215.
---

rcconf:
ntpd_enable="YES"
ntpd_sync_on_start="YES"
 
Checking `rcorder /etc/rc.d/* /usr/local/etc/rcd/*` have correct order (?):
 
<snip>
/etc/rc.d/ntpdate
...
/etc/rc.d/sdpd
/etc/rc.d/rarpd
/etc/rc.d/powerd
/etc/rc.d/ntpd
/etc/rc.d/nscd
/usr/local/etc/rc.d/dbus
/usr/local/etc/rc.d/git_daemon
/usr/local/etc/rc.d/noip
/etc/rc.d/rfcomm_pppd_server
/etc/rc.d/mountd
/etc/rc.d/swaplate
...
Strange that noip doesn't get correct date at boot time.
 
Do I missing something?
 
Thanks!
 
--
Nuno Teixeira
FreeBSD Committer (ports)


Hi,

In my rcorder output noip2 comes before ntpd.
But I have in rc.conf:
ntpdate_enable="YES"
ntpd_enable="YES"

ntpdate is run more early in the rcorder.

I don't know about ntpd_sync_on_start and if that influences the rcorder. I think it is just an option to ntpd.

Please try to add ntpdate_enable="YES".

BTW: if you run ZFS-on-boot on RPI you can use sysutils/fakertc to get a bit better time at boot. In UFS the time is stored on disk on unmount/shutdown which is used to set the time on startup. ZFS does not have this feature. Fakertc mimics this as good as it can which can help to have a "decent" time to make TLS certificates, etc. valid on boot.

Regards,
Ronald.
  ------=_Part_7272_1355329237.1711541383387--