From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Simon Kelley <simon@thekelleys.org.uk>
Cc: cerowrt-devel@lists.bufferbloat.net
Subject: Re: [Cerowrt-devel] DNSSEC & NTP Bootstrapping -- prototype!
Date: Sat, 29 Mar 2014 11:55:40 +0100 [thread overview]
Message-ID: <87bnwpb7f7.fsf_-_@alrua-x1.karlstad.toke.dk> (raw)
In-Reply-To: <87k3bdbbt6.fsf@alrua-x1.karlstad.toke.dk> ("Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen=22's?= message of "Sat, 29 Mar 2014 10:20:53 +0100")
[-- Attachment #1.1: Type: text/plain, Size: 2102 bytes --]
Right, so I took a stab at prototyping something based on the
--dnssec-no-timecheck option Simon just added to dnsmasq.
There's an updated dnsmasq package here:
http://archive.tohojo.dk/cerowrt/wndr/3.10.32-12-tohojo/packages/dnsmasq-dhcpv6_2014-03-29-b7639d58158c6e971535893b407560e136a27994_ar71xx.ipk
Which, apart from the change to dnsmasq itself, has a modification to
the init script that will add the parameter to dnsmasq on bootup (but
not on subsequent restarts), and then spawn a script that will check the
ntpd stratum status and wait for it to be set; or, if no stratum
information is available just set the time with ntpd -q. Once either the
time has been set, or ntpd reports a valid stratum, dnsmasq is sent
SIGHUP to turn dnssec time validation back on.
To get ntpd to report its stratum status, it is spawned with the -S
parameter which will periodically report its status, including stratum.
A small script then records that in a file which the dnsmasq script
checks. Since the script falls back to running ntpd -q, this change to
ntpd is not strictly necessary; but I thought it better to make it
available rather than running a second ntp sync on top of the running
ntpd server. To enable the ntpd modification, replace
/etc/init.d/sysntpd with the attached file, put this into
/usr/sbin/ntpd_record_stratum and chmod +x it:
#!/bin/sh
echo $stratum > /var/ntp.stratum
There's a busybox package with this modification included here, but I
can't promise it is built with the exact same options as the one
distributed with cerowrt (though it works for me):
http://archive.tohojo.dk/cerowrt/wndr/3.10.32-12-tohojo/packages/busybox_1.19.4-7_ar71xx.ipk
Please test this out and let me know if it works for you. It seems to
work for me; however, I have not been successful in actually getting my
router to boot up without the time synced. Not sure if it's just ntpd
that syncs up before the script runs (and then takes a while to update
its stratum), or if some hidden mechanism does something magical to set
the time (even when the *fixtime init scripts are disabled).
-Toke
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: sysntpd --]
[-- Type: text/x-sh, Size: 749 bytes --]
#!/bin/sh /etc/rc.common
# Copyright (C) 2011 OpenWrt.org
START=98
USE_PROCD=1
PROG=/usr/sbin/ntpd
validate_ntp_section() {
uci_validate_section system timeserver "${1}" \
'server:list(host)' 'enable_server:bool:0'
}
start_service() {
local server enable_server peer
validate_ntp_section ntp || {
echo "validation failed"
return 1
}
[ -z "$server" ] && return
procd_open_instance
procd_set_param command "$PROG" -n -S /usr/sbin/ntpd_record_stratum
[ "$enable_server" = "1" ] && procd_append_param command -l
for peer in $server; do
procd_append_param command -p $peer
done
procd_set_param respawn
procd_close_instance
}
service_triggers()
{
procd_add_reload_trigger "system"
procd_add_validation validate_ntp_section
}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 489 bytes --]
next prev parent reply other threads:[~2014-03-29 10:55 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-22 3:33 [Cerowrt-devel] DNSSEC & NTP Bootstrapping Joseph Swick
2014-03-22 17:42 ` Dave Taht
2014-03-22 18:43 ` Simon Kelley
2014-03-22 19:38 ` Toke Høiland-Jørgensen
2014-03-22 19:42 ` Simon Kelley
2014-03-22 20:00 ` Toke Høiland-Jørgensen
2014-03-24 21:39 ` Simon Kelley
2014-03-27 20:38 ` Simon Kelley
2014-03-28 7:57 ` Toke Høiland-Jørgensen
2014-03-28 9:08 ` Simon Kelley
2014-03-28 9:18 ` Toke Høiland-Jørgensen
2014-03-28 10:41 ` Simon Kelley
2014-03-28 10:48 ` Toke Høiland-Jørgensen
2014-03-28 19:46 ` Simon Kelley
2014-03-28 20:55 ` Simon Kelley
2014-03-29 9:20 ` Toke Høiland-Jørgensen
2014-03-29 10:55 ` Toke Høiland-Jørgensen [this message]
2014-03-29 21:21 ` [Cerowrt-devel] DNSSEC & NTP Bootstrapping -- prototype! Michael Richardson
2014-03-29 21:30 ` Dave Taht
2014-03-30 13:21 ` Toke Høiland-Jørgensen
2014-03-30 16:59 ` Dave Taht
2014-03-30 18:38 ` Toke Høiland-Jørgensen
2014-03-30 19:30 ` Toke Høiland-Jørgensen
2014-03-30 20:06 ` Dave Taht
2014-03-30 20:51 ` Toke Høiland-Jørgensen
2014-03-31 12:42 ` Robert Bradley
2014-03-31 17:26 ` Robert Bradley
2014-03-22 21:15 ` [Cerowrt-devel] DNSSEC & NTP Bootstrapping Joseph Swick
2014-03-23 10:12 ` Aaron Wood
2014-03-23 11:15 ` Toke Høiland-Jørgensen
2014-03-23 12:11 ` David Personette
2014-03-23 12:20 ` Toke Høiland-Jørgensen
2014-03-23 12:22 ` Aaron Wood
2014-03-23 22:41 ` Michael Richardson
2014-03-24 9:51 ` Aaron Wood
2014-03-24 9:59 ` Toke Høiland-Jørgensen
2014-03-24 12:29 ` Chuck Anderson
2014-03-24 13:39 ` Toke Høiland-Jørgensen
2014-03-24 14:31 ` Alijah Ballard
2014-03-24 13:54 ` Valdis.Kletnieks
2014-03-24 19:12 ` Phil Pennock
2014-03-24 20:27 ` David Personette
2014-03-24 21:30 ` Phil Pennock
2014-03-24 21:58 ` Dave Taht
2014-03-25 9:55 ` David Personette
2014-03-25 14:25 ` Michael Richardson
2014-03-24 21:03 ` Toke Høiland-Jørgensen
2014-03-24 22:09 ` Török Edwin
2014-03-24 23:33 ` Toke Høiland-Jørgensen
2014-03-25 1:16 ` Joseph Swick
2014-03-24 22:16 ` Phil Pennock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.bufferbloat.net/postorius/lists/cerowrt-devel.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bnwpb7f7.fsf_-_@alrua-x1.karlstad.toke.dk \
--to=toke@toke.dk \
--cc=cerowrt-devel@lists.bufferbloat.net \
--cc=simon@thekelleys.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox