Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2766017
  • 博文数量: 587
  • 博客积分: 6356
  • 博客等级: 准将
  • 技术积分: 6410
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-23 10:54
个人简介

器量大者,福泽必厚

文章分类

全部博文(587)

文章存档

2019年(3)

2018年(1)

2017年(29)

2016年(39)

2015年(66)

2014年(117)

2013年(136)

2012年(58)

2011年(34)

2010年(50)

2009年(38)

2008年(16)

分类: LINUX

2010-02-05 09:15:45

1:下载的ipvsadm-1.24-6.src.rpm,
2:rpmbuild --rebuild ipvsadm-1.24-6.src.rpm 出错,信息如下:
 

make -C libipvs
make[1]: Entering directory `/var/tmp/ipvsadm-1.24/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -DHAVE_NET_IP_VS_H -c -o libipvs.o libipvs.c
In file included from libipvs.c:23:
libipvs.h:14:23: net/ip_vs.h: No such file or directory
In file included from libipvs.c:23:
libipvs.h:119: error: syntax error before "fwmark"
libipvs.h:119: warning: function declaration isn'
t a prototype
libipvs.c:27: error: field `svc' has incomplete type
libipvs.c:28: error: field `dest'
has incomplete type
libipvs.c: In function `ipvs_init':
libipvs.c:40: error: invalid application of `sizeof'
to incomplete type `ip_vs_getinfo'
libipvs.c:44: error: `IP_VS_SO_GET_INFO'
undeclared (first use in this function)
libipvs.c:44: error: (Each undeclared identifier is reported only once
libipvs.c:44: error: for each function it appears in.)
libipvs.c: In function `ipvs_getinfo':
libipvs.c:56: error: invalid application of `sizeof'
to incomplete type `ip_vs_getinfo'
libipvs.c:57: error: `IP_VS_SO_GET_INFO'
undeclared (first use in this function)
libipvs.c: In function `ipvs_version':
libipvs.c:64: error: invalid use of undefined type `struct ip_vs_getinfo'

libipvs.c: In function `ipvs_flush':
libipvs.c:70: error: `IP_VS_SO_SET_FLUSH'
undeclared (first use in this function)
libipvs.c: In function `ipvs_add_service':
libipvs.c:79: error: `IP_VS_SO_SET_ADD'
undeclared (first use in this function)
libipvs.c:79: error: dereferencing pointer to incomplete type
libipvs.c: In function `ipvs_update_service':
libipvs.c:87: error: `IP_VS_SO_SET_EDIT'
undeclared (first use in this function)
libipvs.c:87: error: dereferencing pointer to incomplete type
libipvs.c: In function `ipvs_del_service':
libipvs.c:95: error: `IP_VS_SO_SET_DEL'
undeclared (first use in this function)
libipvs.c:95: error: dereferencing pointer to incomplete type
libipvs.c: In function `ipvs_zero_service':
libipvs.c:103: error: `IP_VS_SO_SET_ZERO'
undeclared (first use in this function)
libipvs.c:103: error: dereferencing pointer to incomplete type
libipvs.c: In function `ipvs_add_dest':
libipvs.c:109: error: dereferencing pointer to incomplete type
libipvs.c:109: error: dereferencing pointer to incomplete type
libipvs.c:112: error: `IP_VS_SO_SET_ADDDEST'
undeclared (first use in this function)
libipvs.c: In function `ipvs_update_dest':
libipvs.c:119: error: dereferencing pointer to incomplete type
libipvs.c:119: error: dereferencing pointer to incomplete type
libipvs.c:122: error: `IP_VS_SO_SET_EDITDEST'
undeclared (first use in this function)
libipvs.c: In function `ipvs_del_dest':
libipvs.c:129: error: dereferencing pointer to incomplete type
libipvs.c:129: error: dereferencing pointer to incomplete type
libipvs.c:132: error: `IP_VS_SO_SET_DELDEST'
undeclared (first use in this function)
libipvs.c: In function `ipvs_set_timeout':
libipvs.c:140: error: `IP_VS_SO_SET_TIMEOUT'
undeclared (first use in this function)
libipvs.c:141: error: dereferencing pointer to incomplete type
libipvs.c: In function `ipvs_start_daemon':
libipvs.c:148: error: `IP_VS_SO_SET_STARTDAEMON'
undeclared (first use in this function)
libipvs.c:149: error: dereferencing pointer to incomplete type
libipvs.c: In function `ipvs_stop_daemon':
libipvs.c:156: error: `IP_VS_SO_SET_STOPDAEMON'
undeclared (first use in this function)
libipvs.c:157: error: dereferencing pointer to incomplete type
libipvs.c: In function `ipvs_get_services':
libipvs.c:166: error: dereferencing pointer to incomplete type
libipvs.c:167: error: invalid application of `sizeof'
to incomplete type `libipvs.h'
libipvs.c:167: error: invalid use of undefined type `struct ip_vs_getinfo'

libipvs.c:172: error: dereferencing pointer to incomplete type
libipvs.c:172: error: invalid use of undefined type `struct ip_vs_getinfo'
libipvs.c:174: error: `IP_VS_SO_GET_SERVICES'
undeclared (first use in this function)
libipvs.c: In function `ipvs_cmp_services':
libipvs.c:189: error: dereferencing pointer to incomplete type
libipvs.c:189: error: dereferencing pointer to incomplete type
libipvs.c:193: error: dereferencing pointer to incomplete type
libipvs.c:193: error: dereferencing pointer to incomplete type
libipvs.c:197: error: dereferencing pointer to incomplete type
libipvs.c:197: error: dereferencing pointer to incomplete type
libipvs.c:201: error: dereferencing pointer to incomplete type
libipvs.c:201: error: dereferencing pointer to incomplete type
libipvs.c: In function `ipvs_sort_services'
:
libipvs.c:208: error: dereferencing pointer to incomplete type
libipvs.c:208: error: dereferencing pointer to incomplete type
libipvs.c:209: error: invalid application of `sizeof' to incomplete type `libipvs.h'
libipvs.c: In function `ipvs_get_dests':
libipvs.c:218: error: dereferencing pointer to incomplete type
libipvs.c:218: error: invalid application of `sizeof'
to incomplete type `libipvs.h'
libipvs.c:218: error: dereferencing pointer to incomplete type
libipvs.c:224: error: dereferencing pointer to incomplete type
libipvs.c:224: error: dereferencing pointer to incomplete type
libipvs.c:225: error: dereferencing pointer to incomplete type
libipvs.c:225: error: dereferencing pointer to incomplete type
libipvs.c:226: error: dereferencing pointer to incomplete type
libipvs.c:226: error: dereferencing pointer to incomplete type
libipvs.c:227: error: dereferencing pointer to incomplete type
libipvs.c:227: error: dereferencing pointer to incomplete type
libipvs.c:228: error: dereferencing pointer to incomplete type
libipvs.c:228: error: dereferencing pointer to incomplete type
libipvs.c:231: error: `IP_VS_SO_GET_DESTS'
undeclared (first use in this function)
libipvs.c: In function `ipvs_cmp_dests':
libipvs.c:243: error: dereferencing pointer to incomplete type
libipvs.c:243: error: dereferencing pointer to incomplete type
libipvs.c:247: error: dereferencing pointer to incomplete type
libipvs.c:247: error: dereferencing pointer to incomplete type
libipvs.c: In function `ipvs_sort_dests'
:
libipvs.c:253: error: dereferencing pointer to incomplete type
libipvs.c:253: error: dereferencing pointer to incomplete type
libipvs.c:254: error: invalid application of `sizeof' to incomplete type `libipvs.h'
libipvs.c: At top level:
libipvs.c:259: error: syntax error before "fwmark"
libipvs.c:260: warning: function declaration isn't a prototype
libipvs.c: In function `ipvs_get_service'
:
libipvs.c:264: error: dereferencing pointer to incomplete type
libipvs.c:270: error: dereferencing pointer to incomplete type
libipvs.c:270: error: `fwmark' undeclared (first use in this function)
libipvs.c:271: error: dereferencing pointer to incomplete type
libipvs.c:271: error: `protocol'
undeclared (first use in this function)
libipvs.c:272: error: dereferencing pointer to incomplete type
libipvs.c:272: error: `addr' undeclared (first use in this function)
libipvs.c:273: error: dereferencing pointer to incomplete type
libipvs.c:273: error: `port'
undeclared (first use in this function)
libipvs.c:274: error: `IP_VS_SO_GET_SERVICE' undeclared (first use in this function)
libipvs.c: In function `ipvs_get_timeout'
:
libipvs.c:288: error: dereferencing pointer to incomplete type
libipvs.c:293: error: `IP_VS_SO_GET_TIMEOUT' undeclared (first use in this function)
libipvs.c: In function `ipvs_get_daemon'
:
libipvs.c:309: error: dereferencing pointer to incomplete type
libipvs.c:315: error: `IP_VS_SO_GET_DAEMON' undeclared (first use in this function)
libipvs.c: At top level:
libipvs.c:33: error: storage size of `ipvs_info'
isn't known
make[1]: *** [libipvs.o] Error 1
make[1]: Leaving directory `/var/tmp/ipvsadm-1.24/libipvs'

make: *** [libs] Error 2

开始我怀疑是自己的kernel版本和下载的rpm包不兼容!后来慢慢的排除了这个原因!

首先要确认安装了kernel*.rpm相关的包!可以通过红色字体部分确认,如果没有,则需要安装kernel*.rpm包

 

[root@qhtlnx25 ~]# cd  /usr/src/kernels/
[root@qhtlnx25 kernels]# ls
2.6.9-42.EL-hugemem-i686  2.6.9-42.EL-i686  2.6.9-42.EL-smp-i686 

[root@qhtlnx25 kernels]# uname  -r
2.6.9-42.ELsmp  ###做链接时要用到到这个

ln -s /usr/src/kernels/2.6.9-42.EL-smp-i686  /usr/src/linux

然后再次执行rpmbuild --rebuild ipvsadm-1.24-6.src.rpm 就不会出错了(前提是下载的rpm包和你的系统内核兼容,下载ipvsadm*.rpm时要看清楚)

安装过程中的输出:

[root@nodelb2 home]# rpmbuild --rebuild ipvsadm-1.24-6.src.rpm
Installing ipvsadm-1.24-6.src.rpm
warning: user wensong does not exist - using root
warning: group wensong does not exist - using root
warning: user wensong does not exist - using root
warning: group wensong does not exist - using root
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.49535
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf ipvsadm-1.24
+ /usr/bin/gzip -dc /usr/src/redhat/SOURCES/ipvsadm-1.24.tar.gz
+ tar -xvvf -
-rw-rw-r-- wensong/wensong 2883 2003-06-20 11:07:35 ipvsadm-1.24/config_stream.c
drwxr-xr-x Creating directory: ipvsadm-1.24
-rw-rw-r-- wensong/wensong 419 2003-06-20 11:07:35 ipvsadm-1.24/config_stream.h
drwxrwxr-x wensong/wensong 0 2003-07-30 18:04:38 ipvsadm-1.24/contrib/
-rw-rw-r-- wensong/wensong 793 2002-08-10 12:32:39 ipvsadm-1.24/contrib/popt-optional.diff
drwxrwxr-x wensong/wensong 0 2003-07-30 18:04:38 ipvsadm-1.24/debian/
-rw-rw-r-- wensong/wensong 94 2001-01-11 22:14:59 ipvsadm-1.24/debian/ipvsadm.files
-rw-rw-r-- wensong/wensong 169 2001-01-11 22:14:59 ipvsadm-1.24/debian/changelog
-rw-rw-r-- wensong/wensong 327 2001-01-11 22:14:59 ipvsadm-1.24/debian/control
-rw-rw-r-- wensong/wensong 1876 2001-01-11 22:14:59 ipvsadm-1.24/debian/copyright
-rw-rw-r-- wensong/wensong 1 2001-01-11 22:14:59 ipvsadm-1.24/debian/ipvsadm.dirs
-rw-rw-r-- wensong/wensong 1061 2001-01-11 22:14:59 ipvsadm-1.24/debian/rules
-rw-rw-r-- wensong/wensong 8362 2003-06-20 11:07:35 ipvsadm-1.24/dynamic_array.c
-rw-rw-r-- wensong/wensong 6583 2003-06-20 11:07:35 ipvsadm-1.24/dynamic_array.h
-rw-rw-r-- wensong/wensong 23233 2005-12-11 00:00:07 ipvsadm-1.24/ipvsadm.8
-rw-rw-r-- wensong/wensong 52634 2005-12-11 00:00:07 ipvsadm-1.24/ipvsadm.c
-rw-rw-r-- wensong/wensong 629 2002-08-10 12:32:38 ipvsadm-1.24/ipvsadm-restore
-rw-rw-r-- wensong/wensong 576 2001-03-22 20:57:46 ipvsadm-1.24/ipvsadm-restore.8
-rw-rw-r-- wensong/wensong 797 2001-03-22 20:57:46 ipvsadm-1.24/ipvsadm-save
-rw-rw-r-- wensong/wensong 644 2001-03-22 20:57:46 ipvsadm-1.24/ipvsadm-save.8
-rw-rw-r-- wensong/wensong 2423 2002-08-10 12:32:38 ipvsadm-1.24/ipvsadm.sh
-rw-rw-r-- wensong/wensong 2837 2005-12-11 00:00:48 ipvsadm-1.24/ipvsadm.spec
-rw-rw-r-- wensong/wensong 2854 2005-06-27 00:24:48 ipvsadm-1.24/ipvsadm.spec.in
drwxrwxr-x wensong/wensong 0 2005-12-11 00:00:39 ipvsadm-1.24/libipvs/
-rw-rw-r-- wensong/wensong 7915 2003-06-08 17:31:39 ipvsadm-1.24/libipvs/libipvs.c
-rw-rw-r-- wensong/wensong 558 2005-06-26 23:59:51 ipvsadm-1.24/libipvs/Makefile
-rw-rw-r-- wensong/wensong 3933 2003-06-08 17:31:39 ipvsadm-1.24/libipvs/libipvs.h
-rw-rw-r-- wensong/wensong 4205 2005-12-11 00:00:07 ipvsadm-1.24/Makefile
-rw-rw-r-- wensong/wensong 2010 2002-01-24 22:23:51 ipvsadm-1.24/README
-rw-rw-r-- wensong/wensong 38 2003-05-10 11:05:26 ipvsadm-1.24/SCHEDULERS
-rw-rw-r-- wensong/wensong 12123 2005-01-22 11:53:47 ipvsadm-1.24/TAGS
-rw-rw-r-- wensong/wensong 5 2003-06-08 17:31:36 ipvsadm-1.24/VERSION
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd ipvsadm-1.24
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.49535
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd ipvsadm-1.24
+ LANG=C
+ export LANG
+ unset DISPLAY
+ CFLAGS='-O2 -g -pipe -m32 -march=i386 -mtune=pentium4'
+ make
make -C libipvs
make[1]: Entering directory `/usr/src/redhat/BUILD/ipvsadm-1.24/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -DHAVE_NET_IP_VS_H -c -o libipvs.o libipvs.c
ar rv libipvs.a libipvs.o
ar: creating libipvs.a
a - libipvs.o
make[1]: Leaving directory `/usr/src/redhat/BUILD/ipvsadm-1.24/libipvs'

gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -I.. -I. -DVERSION=\"1.24\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\" -DHAVE_POPT -DHAVE_NET_IP_VS_H -c -o ipvsadm.o ipvsadm.c
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -I.. -I. -DVERSION=\"1.24\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\" -DHAVE_POPT -DHAVE_NET_IP_VS_H -c -o config_stream.o config_stream.c
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -I.. -I. -DVERSION=\"1.24\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\" -DHAVE_POPT -DHAVE_NET_IP_VS_H -c -o dynamic_array.o dynamic_array.c
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a -L/usr/lib -lpopt
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.69956
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd ipvsadm-1.24
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /var/tmp/ipvsadm-1.24-root
+ mkdir -p /var/tmp/ipvsadm-1.24-root/sbin /var/tmp/ipvsadm-1.24-root//usr/share/man/man8 /var/tmp/ipvsadm-1.24-root/etc/rc.d/init.d
+ make install BUILD_ROOT=/var/tmp/ipvsadm-1.24-root MANDIR=/usr/share/man
make -C libipvs
make[1]: Entering directory `/usr/src/redhat/BUILD/ipvsadm-1.24/libipvs'
make[1]: Nothing to be done for `all'
.
make[1]: Leaving directory `/usr/src/redhat/BUILD/ipvsadm-1.24/libipvs

[root@nodelb2 home]# cd /usr/src/redhat/RPMS/i386/
[root@nodelb2 i386]# ls
ipvsadm-1.24-6.i386.rpm  ipvsadm-debuginfo-1.24-6.i386.rpm
[root@nodelb2 i386]# rpm -ivh ipvsadm-1.24-6.i386.rpm
Preparing...                ########################################### [100%]
   1:ipvsadm                ########################################### [100%]
[root@nodelb2 i386]# rpm -ivh ipvsadm-debuginfo-1.24-6.i386.rpm
Preparing...                ########################################### [100%]
   1:ipvsadm-debuginfo      ########################################### [100%]
[root@nodelb2 i386]#

留为笔记!

新版本的ipvsadm configure时也遇到了问题:

yum -y install  popt-devel
yum -y install  libnl-devel
yum -y install  popt-static
ln -s  /usr/src/kernels/`uname -r`  /usr/src/linux  ###
tar zxvf ipvsadm-1.26.tar.gz 
cd ipvsadm-1.26
make
make install
阅读(2985) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~