手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

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

[日期:2014-12-06] 来源:Linux社区  作者:JL_bai [字体: ]

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

本文永久更新链接地址http://www.linuxidc.com/Linux/2014-12/110254.htm

linux
相关资讯       NTP 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款