阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

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

163次阅读
没有评论

共计 2344 个字符,预计需要花费 6 分钟才能阅读完成。

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,里的内容有的需要缩进,以 #开关内容须缩进

————————————– 分割线 ————————————–

CentOS NTP 服务器安装与配置 http://www.linuxidc.com/Linux/2014-01/95258.htm

Linux 实战部署系列之 NTP 服务器 http://www.linuxidc.com/Linux/2013-11/92275.htm

多种操作系统 NTP 客户端配置 http://www.linuxidc.com/Linux/2013-10/91928.htm

搭建企业级 NTP 时间服务器 http://www.linuxidc.com/Linux/2014-02/97205.htm

Linux 下快速搭建 ntp 时间同步服务器 http://www.linuxidc.com/Linux/2014-07/104371.htm

CentOS 6.3 下实现 NTP 时间服务器 http://www.linuxidc.com/Linux/2014-08/105414.htm

————————————– 分割线 ————————————–

更多 SUSE 相关信息见SUSE 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=3

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计2344字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中