前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SUSE Linux ntp 升级报错(MAKE [1]:*** 【all】Error 2)

SUSE Linux ntp 升级报错(MAKE [1]:*** 【all】Error 2)

作者头像
星哥玩云
发布2022-07-03 16:46:07
4.1K0
发布2022-07-03 16:46:07
举报
文章被收录于专栏:开源部署开源部署

NTP升级,升级RedHat时很顺利,升级完成后会默认覆盖掉原有文件,重启服务后,使用ntpd --version查看验证上即可,可在升级SUSE Linux时却发现错误频频,以下是我再升级时遇到的一些问题,小结之后希望有和我遇到同样错误的亲们可以作为参考:

 一. 由于NTP包有漏洞,需下载4.2.7之后版本,网络下ntp-dev-4.2.7p26.tar.gz  1.解压 #  tar –zxf  ntp-dev-4.2.7p26.tar.gz –C /usr/src  2.编译 #  cd/usr/src/ntp-dev-4.2.7p26  #./configure --prefix=/usr/local/ntp-dev-4.2.7p26--enable-all-clocks --enable-parse-clocks 如果生成Makefile文件时报错,提示信息为usge –-host skip在./configure 参数后添加--host=x86_64,这个参数(x86_64)来源于uname –m后得出的结果

  3. #make 如果make报错,信息如下 ntp_loopfilter.c: In function ‘local_clock’: ntp_loopfilter.c:516: error: ‘MOD_NANO’ undeclared (first use in this function)  ntp_loopfilter.c:516: error: (Each undeclaredidentifier is reported only once  ntp_loopfilter.c:516: error: for each function itappears in.)  make[3]: *** [ntp_loopfilter.o] Error 1  make[3]: Leaving directory`/usr/src/ntp-dev-4.2.7p26/ntpd'  make[2]: *** [all] Error 2  make[2]: Leaving directory`/usr/src/ntp-dev-4.2.7p26/ntpd'  make[1]: *** [all-recursive] Error 1  make[1]: Leaving directory `/usr/src/ntp-dev-4.2.7p26'  make: *** [all] Error 2

解决方法如下: vim include/ntp_syscall.h.patch

 --- ntp-4.2.4p7/include/ntp_syscall.h  +++ ntp-4.2.4p7/include/ntp_syscall.h  @@ -14,5+14,13 @@  #include<sys/timex.h>  #endif  +#if defined(ADJ_NANO) && !defined(MOD_NANO)  +#define MOD_NANO ADJ_NANO  +#endif  +  +#if defined(ADJ_TAI) && !defined(MOD_TAI)  +#define MOD_TAI ADJ_TAI  +#endif  +  #ifndefNTP_SYSCALLS_LIBC  #ifdefNTP_SYSCALLS_STD

 # cd include  # patch -p0 < ntp_syscall.h.patch  patch file to:ntp_syscall.h  # cd ..  # make && make install 编译安装OK  4.生成环境变量 # echo '#ntp seting' >>  /etc/profile.local  # echo 'export PATH=$PATH:/usr/local/ntp/bin'>>  /etc/profile.local  #echo /usr/local/ntp/bin/ntpd -c /etc/ntp.conf -p/tmp/ntpd.pid >> /etc/profile.local  # source /etc/profile.local  5 验证 # ntpd –version 版本已升级为4.2.7p26

ps:

vim include/ntp_syscall.h.patch ,里的内容有的需要缩进,以#开关内容须缩进

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档