问题标签 [ntpd]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
134 浏览

time - NTPD可以更严格地纠正时间吗?

NTP 在将我的本地时间与各种 NTP 服务器同步方面做得最好。如果我的电脑(没有硬件时钟)长时间不能上网,时间就会开始漂移。NTPD 重新上线时会慢慢纠正,但如果偏移量很大,可能需要很长时间。我理解这种方法的要点,但我不希望它小心。我希望它严格地更改日期和时间,即使这意味着时间上的巨大飞跃。

是否有可能让NTPD更严格、更不小心?

0 投票
1 回答
1701 浏览

linux - 手臂盒上的 NTPD 版本 4.2.6p5

我已经成功地为我的 arm box 交叉编译了 ntpd 4.2.6p5。我有制造商提供的自定义工具链。

Box 正在运行busybox + debian linux 的一些变体。

所以我没有安装 ntp 并进行了手动复制,为 ntpd 创建了一个 conf 文件并尝试运行它。

ntpd 在调试模式下总是返回这个: ~/ntp # ./ntpd -c ntp.conf -d

在此之前,我还必须添加到 /etc/services

我的 ntp.conf 看起来像:

所以我检查了 netstat 并没有在端口 123 上运行,没有 ntpdate 等...

因此它必须是配置的东西,或者这个手臂盒没有配置东西......

哦,手动运行 ntpdate 有效:

所以是的,我可以在 cron 中使用 ntpdate,但这不是我的意图!

任何想法?

感谢你并致以真诚的问候!

0 投票
2 回答
896 浏览

linux - 使用 NTP 瞬时同步

我正在使用两台 PC:PC1(服务器)和 PC2(客户端),我正在尝试将它们的时间与 NTP 同步。PC1 未配置为与任何外部时间源同步。我只想PC1上的任何时间,PC2都应该按照那个同步。我已经完成了以下更改-:

在 PC1(服务器)-:

在 PC2(客户端)中-:

我还通过添加以下几行更改了双方的防火墙设置:

但是,我无法将 PC2 日期与 PC1 日期同步,即当我在 PC1 中更改日期时,更改不会立即反映在 PC2 中。我正在使用 RHEL 6.2 。

谁能告诉我哪里出错了??

0 投票
3 回答
33937 浏览

synchronization - 找不到适合同步的服务器 对于 NTP 服务

我必须ntp从源代码构建软件包并将它们全部安装在某些主机上。安装后,ntpdate 1.us.pool.ntp.org进行同步。但是,当我尝试这样做时ntpdate <ip_add_of_another_host>,会显示以下错误

7 月 21 日 18:57:53 ntpdate[18287]:找不到适合同步的服务器

更奇怪的是,有时ntpdate <ip_addr_of_another_host>在我尝试后会起作用ntpdate 1.us.pool.ntp.org

我的ntp服务器配置文件:

当我这样做时,我也尝试了默认配置apt-get install ntp,但它也不起作用。

0 投票
1 回答
139 浏览

c++ - C ++:重新启动ntpd的系统调用->错误的端口

目前我正在写我的硕士论文,在 C++ 中遇到了一个小问题。在某些情况下,我必须重新启动 ntp 守护进程,因此我调用:

但是经过这个ntp监听的不是123端口,而是8377和8378。这个端口属于一个udp通道,在C++-prog中使用。

有人知道这种恶意行为吗?

谢谢 :)

0 投票
1 回答
351 浏览

time - Which OS for cortex-m4 offering NTPd or similar to enable time sync with GPS-PPS

I've received these 3 boards as a gift.

STM32F407 HIGH PERF DISCOVERY BOARD http://www2.mouser.com/Search/ProductDetail.aspx?R=STM32F4DISCOVERYvirtualkey51120000virtualkey511-STM32F4DISCOVERY

STMicroelectronics STM32F411 Nucleo board http://www2.mouser.com/Search/ProductDetail.aspx?R=NUCLEO-F411REvirtualkey51120000virtualkey511-NUCLEO-F411RE

STM32F429 Discovery Kit Board http://www2.mouser.com/Search/ProductDetail.aspx?R=STM32F429I-DISCOvirtualkey51120000virtualkey511-STM32F429I-DISCO

They have these CPUs:

STM32F407 @ 168 MHz STM32F411 @ 100 MHz STM32F429 @ 180 MHz

I also have a good GPS module with serial and PPS output. I'm wondering if a small Linux version exists for one of these CPU/boards, allowing me to configure the NTPd service to get the internal clock in sync with the GPS like seen on other boards like the Raspberry PI.

It is my understanding that usually the NTPd also uses the network interface for connection with other time servers or publishing of the information on the network. These boards do not have network chips/connectors and actually I'm not interested in connecting them with the external world. I would use the synced clock only on the choosen board itself.

As an alternative to a small linux edition, would this be something feasible with a different embedded or real time OS ?

or with a NTPd only port ?

thank you

Added text:

I would like to find the best approach to re-use any existing code to get time from gps, write to rtc AND sync to PPS.

i know that reading GPS received time via serial and writing to rtc is easy but i need to use also the sync logic to the PPS signal to get the lowest possible jitter within my budget constraints.

i need to save money and cannot buy off-the-shelf devices. if i can avoid the use of an os and stick to something smaller like an RTOS or embedded or custom code... well i would be happy :-)

i mentioned NTPd because is the only thing i know (my limitation) that allows these things (plus others).

did somebody else already "strip away" the PPS sync related portions of code ? or are them actually the core of NTPd and PPS is just a plugged in additional source like the network servers could be ?

please note that i'm a total newbie to the inner working of NTPd. I just configured gps-pps-ntpd sync on a raspberry pi following web available instructions to test the concept, but that does not make me ... an expert of NTPd :-)

0 投票
1 回答
2858 浏览

linux - 运行 NTPD 的 Linux 服务器会受到 2015 年增加闰秒计划的影响吗?

已经读到有计划在 2015 年 6 月添加闰秒。在工作中,我们正在运行许多ntpd已安装的 Linux (Ubuntu) 服务器,以保持时间同步和正确。

有谁知道这个时间变化将如何影响我们,即除了让我们ntpd更正时间之外,我们是否需要做任何事情?

我在NTPNTPD的网站上找不到任何信息。

就上下文而言,我们运行 PHP/Apache/Solr/MySQL 服务器,并与提供时间相关响应的第三方 API 交互,例如历史汇率或地理位置。

0 投票
2 回答
2710 浏览

linux - ntpd 同步后执行脚本

我有树莓派和树莓派。我想在时间与 ntpd 同步后立即执行一个脚本,我的脚本需要正确的日期时间。我怎样才能做到这一点?

0 投票
0 回答
127 浏览

ntp - 即使在 Redpitaya OS Rebuild 之后,NTPClient 也无法正常工作

我正在尝试在 redpitaya 上运行 NTPD 服务。我关注了这个博客(redpitaya 的 NTP 客户端)并使用此链接从头开始构建内核:http ://wiki.redpitaya.com/index.php?title=Red_Pitaya_OS 。

但是,即使在构建根目录的配置文件中具有条目“BR2_PACKAGE_NTP=y”的配置文件以及busy box.config中的“CONFIG_NTPD=y”和“CONFIG_FEATURE_NTPD_SERVER =y”的配置文件的全新构建之后,它仍然无法正常工作。wget 和 * 等其他一些功能开始工作,但不是必需的 NTPD 服务。请帮助我纠正这个问题。

0 投票
1 回答
7485 浏览

ntpd - 是否有任何 ntpd 可以配置为仅侦听选定的接口?

我的情况是,我为虚拟机配置了许多虚拟网络接口,我的一些网络甚至有两个或更多地址。我不需要ntpd听所有这些接口,但似乎没有限制 ntpd 尝试绑定的接口的选项。除了 ntpd 中的所有这些“安全”选项之外,对于了解其环境的系统管理员来说,最好的安全选项是根本不听接口。例如,根本不监听外部接口会更安全,而是通过 ntp 配置限制访问。

是否有任何已知的 ntpd 软件可以配置为仅侦听选定的接口(任何网络守护程序都应该)