NTP自动退出问题排查

本文主要介绍了当ntp进程因时间差超过1000s自动退出的问题,通过查看系统日志和官方文档,了解到可以使用`tinker panic 0`指令避免ntp退出。在配置文件`/etc/ntp.conf`添加此指令后,解决了问题。同时,文章还提供了ntp进程状态和时间同步相关参数的详细解读。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题现象:ntp进程运行一段时间后自动退出


排查过程:

查看/var/log/message ntp异常信息如下

Feb 20 22:54:41 xnu_1 ntpd[2187]: 0.0.0.0 0617 07 panic_stop -28777 s; set clock manually within 1000 s.

Feb 20 22:54:57 xnu_1 ntpd_intres[2193]: parent died before we finished, exiting


查看官方文档,有如下说明:

-g

Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, ntpd will exit with a message to the system log. This option can be used with the -q and -x options. See the tinker command for other options.


大意就是,默认情况下如果ntp本地时间与上级ntp时间差超过1000s,那么ntp进程就会退出并在系统日志文件中记录。

可以使用tinker命令调整该阈值:

tinker [allan allan | dispersion dispersion | freq freq | huffpuff

    huffpuff | panic panic | step srep | stepout stepout]

    This command can be used to alter several system variables in

    very exceptional circumstances.  It should occur in the configu-

    ration file before any other configuration options.  The default

    values of these variables have been carefully optimized for a

    wide range of network speeds and reliability expectations. In

    general, they interact in intricate ways that are hard to predict

    and some combinations can result in some very nasty behavior.

    Very rarely is it necessary to change the default values; but,

    some folks cannot resist twisting the knobs anyway and this com-

    mand is for them. Emphasis added: twisters are on their own and

    can expect no help from the support group.


&nbs

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值