前几天,有个要求要安装RANCID软件。RANCID是采用CVS的方式,来存储各种网络路由器,交换机等设备配置的软件。它可以方便的实现网络设备配置文件的存储与管理。可以实时查看任意时间使用过的网络配置。同时还可以对一些更改进行跟踪。
但是RANCID安装起来比较复杂,因为在安装RANCID之前,需要先安装和配置好3个软件,一个是TCL,一个是EXPETC,一个是CVS。在他们都安装好了以后,才可以安装RANCID。
我在这里总结了一下安装RANCID的步骤,希望对大家有所帮助。
首先,我们需要配置编译安装TCL,我这里使用的是tcl的源文件包tcl8.4.14-src.tar.gz。
root@ip2dbserver # cd /opt/ ailf/
root@ip2dbserver # ls
cvs-1.11.22 patch-sunos5.9 tcl8.4.14-src.tar.gz tmp
cvs-1.11.22.zip src tk8.4.14-src.tar.gz
tcl的源文件的压缩包
root@ip2dbserver # gunzip tcl8.4.14-src.tar.gz
root@ip2dbserver # tar xvf tcl8.4.14-src.tar
进入tcl的源文件目录:
root@ip2dbserver # cd tcl8.4.14
root@ip2dbserver # ls
ChangeLog ChangeLog.2001 compat library macosx unix
ChangeLog.1999 README doc license.terms tests win
ChangeLog.2000 changes generic mac tools
*/
查看安装文档
root@ip2dbserver # more README
README: Tcl
This is the Tcl 8.4.14 source distribution.
Tcl/Tk is also available through NetCVS:
http://tcl.sourceforge.net/
You can get any source release of Tcl from the file distributions
link at the above URL.
RCS: @(#) $Id: README,v 1.49.2.17 2006/05/04 13:09:16 dgp Exp $
Contents
--------
1. Introduction
2. Documentation
3. Compiling and installing Tcl
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
因为是在sunos上安装,所以要进入unix目录
root@ip2dbserver # cd unix
查看相应的安装内容
root@ip2dbserver # more README
/*
Tcl UNIX README
---------------
RCS: @(#) $Id: README,v 1.24.2.2 2005/12/03 00:35:44 das Exp $
This is the directory where you configure, compile, test, and install
UNIX versions of Tcl. This directory also contains source files for Tcl
that are specific to UNIX. Some of the files in this directory are
used on the PC or Mac platform too, but they all depend on UNIX
(POSIX/ANSI C) interfaces and some of them only make sense under UNIX.
Updated forms of the information found in this file is available at:
http://www.tcl.tk/doc/howto/compile.html#unix
For information on platforms where Tcl is known to compile, along
with any porting notes for getting it to work on those platforms, see:
http://www.tcl.tk/software/tcltk/platforms.html
The rest of this file contains instructions on how to do this. The
release should compile and run either "out of the box" or with trivial
changes on any UNIX-like system that approximates POSIX, BSD, or System
V. We know that it runs on workstations from Sun, H-P, DEC, IBM, and
SGI, as well as PCs running Linux, BSDI, and SCO UNIX. To compile for
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
查看一下有哪些安装的选项
root@ip2dbserver # ./configure --help
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print ` checking... messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[same as prefix]
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
进行软件配置,这里设定安装目录是/opt/lf/tcl
root@ip2dbserver # ./configure --prefix=/opt/lf/tcl
creating cache ./config.cache
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking dirent.h... yes
checking for errno.h... yes
checking for float.h... yes
checking for values.h... yes
checking for limits.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for sys/wait.h... yes
checking for dlfcn.h... yes
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
编译tcl软件
root@ip2dbserver # make
/*
gcc -pipe -c -O -DTCL_DBGX= -Wall -Wno-implicit-int -fno-strict-aliasing -fPIC -I/opt/ailf/tmp/tcl8.4.14/unix/../generic -I/opt/ailf/tmp/tcl8.4.14/unix -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -D_REENTRANT=1 -D_POSIX_PTHREAD_SEMANTICS=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_DIRENT64=1 -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1 -DWORDS_BIGENDIAN=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -DTCL_SHLIB_EXT=\".so\" /opt/ailf/tmp/tcl8.4.14/unix/../generic/regcomp.c
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
下面就可以对对编译好的软件进行安装
root@ip2dbserver # make install
Making directory /opt/lf/tcl/lib
Making directory /opt/lf/tcl/bin
Installing libtcl8.4.so to /opt/lf/tcl/lib/
Installing tclsh as /opt/lf/tcl/bin/tclsh8.4
Installing tclConfig.sh to /opt/lf/tcl/lib/
Installing libtclstub8.4.a to /opt/lf/tcl/lib/
Making directory /opt/lf/tcl/include
Making directory /opt/lf/tcl/lib/tcl8.4
Making directory /opt/lf/tcl/lib/tcl8.4/http2.5
Making directory /opt/lf/tcl/lib/tcl8.4/http1.0
Making directory /opt/lf/tcl/lib/tcl8.4/opt0.4
Making directory /opt/lf/tcl/lib/tcl8.4/encoding
Making directory /opt/lf/tcl/lib/tcl8.4/msgcat1.3
Making directory /opt/lf/tcl/lib/tcl8.4/tcltest2.2
Installing header files
Installing library files to /opt/lf/tcl/lib/tcl8.4
Installing library http1.0 directory
Installing library http2.5 directory
Installing library opt0.4 directory
Installing library msgcat1.3 directory
Installing library tcltest2.2 directory
Installing library encoding directory
Making directory /opt/lf/tcl/man
Making directory /opt/lf/tcl/man/man1
Making directory /opt/lf/tcl/man/man3
Making directory /opt/lf/tcl/man/mann
Installing and cross-linking top-level (.1) docs
Installing and cross-linking C API (.3) docs
Installing and cross-linking command (.n) docs
改动配置文件,启动新的配置文件
root@ip2dbserver # vi .profile
进入刚安装好的tclsh8.4,看看是否安装成功
root@ip2dbserver # tclsh8.4
% exit
可以使用,安装tcl成功
[ 本帖最后由 sohu2000000 于 2007-5-17 10:59 编辑 ]
[原创]RANCID完全安装实录(续)[/align]在正确的安装了TCL之后,我们就可以EXPECT了,我这里是用的expect的源文件包是expect-5.43
root@ip2dbserver # cd /opt/ailf/tmp
root@ip2dbserver # ls
expect.tar rancid-2.3.2a6.tar tcl8.4.14 tcl8.4.14-src.tar
释放expect的源文件压缩包
root@ip2dbserver # tar xvf expect.tar
x expect-5.43/ChangeLog, 21094 bytes, 42磁带块
x expect-5.43/tcldbg.h, 1681 bytes, 4磁带块
x expect-5.43/Dbg.c, 30967 bytes, 61磁带块
x expect-5.43/tcldbgcf.h.in, 399 bytes, 1磁带块
x expect-5.43/DbgMkfl.in, 8038 bytes, 16磁带块
x expect-5.43/DbgpkgInd.in, 515 bytes, 2磁带块
x expect-5.43/Dbgconfigure, 53213 bytes, 104磁带块
x expect-5.43/Dbgconfig.in, 3363 bytes, 7磁带块
x expect-5.43/FAQ, 75007 bytes, 147磁带块
x expect-5.43/HISTORY, 143501 bytes, 281磁带块
x expect-5.43/INSTALL, 10685 bytes, 21磁带块
x expect-5.43/Makefile.in, 32701 bytes, 64磁带块
x expect-5.43/NEWS, 29291 bytes, 58磁带块
x expect-5.43/README, 14567 bytes, 29磁带块
x expect-5.43/aclocal.m4, 20222 bytes, 40磁带块
x expect-5.43/config.sub, 19106 bytes, 38磁带块
x expect-5.43/config.guess, 38437 bytes, 76磁带块
x expect-5.43/configure, 203262 bytes, 397磁带块
x expect-5.43/configure.in, 36660 bytes, 72磁带块
x expect-5.43/install-sh, 4773 bytes, 10磁带块
……………………………………………………………………………………………….
查看是否解压成功
root@ip2dbserver # ls
expect-5.43 expect.tar rancid-2.3.2a6.tar tcl8.4.14 tcl8.4.14-src.tar
进入源文件目录
root@ip2dbserver # cd expect-5.43
root@ip2dbserver # ls
ChangeLog README exp_command.h exp_main_tk.c exp_simple.c expect.h pkgIndex.in
Dbg.c aclocal.m4 exp_console.c exp_memmove.c exp_strf.c expect.man pty_sgttyb.c
DbgMkfl.in config.guess exp_event.c exp_noevent.c exp_trap.c expect_cf.h.in pty_termios.c
Dbgconfig.in config.sub exp_event.h exp_poll.c exp_tstamp.h expect_comm.h pty_unicos.c
Dbgconfigure configure exp_glob.c exp_prog.h exp_tty.c expect_tcl.h tcldbg.h
DbgpkgInd.in configure.in exp_int.h exp_pty.c exp_tty.h expectk.man tcldbgcf.h.in
FAQ example exp_inter.c exp_pty.h exp_tty_comm.c fixcat tests
HISTORY exp_chan.c exp_log.c exp_regexp.c exp_tty_in.h fixline1 testsuite
INSTALL exp_clib.c exp_log.h exp_regexp.h exp_win.c install-sh vgrindefs
Makefile.in exp_closetcl.c exp_main_exp.c exp_rename.h exp_win.h libexpect.man
NEWS exp_command.c exp_main_sub.c exp_select.c expect.c mkinstalldirs
查看配置选项有哪些
root@ip2dbserver # ./configure --help
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print `checking... messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[same as prefix]
--bindir=DIR user executables in DIR [EPREFIX/bin]
……………………………………………………………………………………………….
查看软件的安装说明
root@ip2dbserver # more INSTALL
This file is INSTALL. It contains installation instructions for Expect.
If you do not have Tcl, get it (Expect s README explains how) and
install it. The rest of these instructions assume that you have Tcl
installed.
If you are installing Expect on a single architecture, or are just
trying it out to see whether it is worth installing, follow the
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
查看都有哪些安装配置文件:
root@ip2dbserver # ./configure --help
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print `checking...‘ messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[same as prefix]
--bindir=DIR user executables in DIR [EPREFIX/bin]
--sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
--libexecdir=DIR program executables in DIR [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data in DIR
[PREFIX/share]
--sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data in DIR
[PREFIX/com]
--localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
--libdir=DIR object code libraries in DIR [EPREFIX/lib]
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
配置编译源文件,指定安装的路径是/opt/lf/expect,并且激活gcc软件
root@ip2dbserver # ./configure --prefix=/opt/lf/expect --with-tcl=/opt/ailf/tmp/tcl8.4.14/unix/ --enable-gcc
指定expect的安装路径是/opt/lf/expect,指定tcl的配置文件的路径是/opt/ailf/tmp/tcl8.4.14/unix,激活gcc的功能
root@ip2dbserver # ./configure --prefix=/opt/lf/expect --with-tcl=/opt/ailf/tmp/tcl8.4.14/unix --enable-gcc
configuring Expect 5.43.0
checking for autoconf... no
checking configure up to date... yes
checking host system type... sparc-sun-solaris2.9
checking target system type... sparc-sun-solaris2.9
checking build system type... sparc-sun-solaris2.9
checking shell to use within Make...
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for building with threads... no (default)
checking for Tcl configuration... found /opt/ailf/tmp/tcl8.4.14/unix/tclConfig.sh
checking Tcl build library... -L/opt/ailf/tmp/tcl8.4.14/unix -ltcl8.4 -ldl -lsocket -lnsl -lm
checking for Tcl_CreateCommand... yes
checking if Tcl library build specification is valid... yes
checking for Tk configuration... configure: warning: Can t find Tk configuration definitions
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
下面对expect源文件进行编译
root@ip2dbserver # make
gcc -pipe -c -I. -I. -I/opt/ailf/tmp/tcl8.4.14/generic -DEXP_VERSION=\"5.43.0\" -DSCRIPTDIR=\"/opt/lf/expect/lib/expect5.43\" -DEXECSCRIPTDIR=\"/opt/lf/expect/lib/expect5.43\" -DTCL_DEBUGGER -DUSE_NON_CONST -DSTTY_BIN=\"/bin/stty\" -DDFLT_STTY="\"sane\"" exp_main_exp.c
if [ "xlibexpect5.43.a" != "xlibexpect5.43.a" ] ; then \
if [ ! -d shared ] ; then \
mkdir shared ; \
else true; fi ; \
gcc -pipe -c -I. -I. -I/opt/ailf/tmp/tcl8.4.14/generic -DEXP_VERSION=\"5.43.0\" -DSCRIPTDIR=\"/opt/lf/expect/lib/expect5.43\" -DEXECSCRIPTDIR=\"/opt/lf/expect/lib/expect5.43\" -DTCL_DEBUGGER -DUSE_NON_CONST -DSTTY_BIN=\"/bin/stty\" -DDFLT_STTY="\"sane\"" exp_main_exp.c -o shared/exp_main_exp.o ; \
fi
gcc -pipe -c -I. -I. -I/opt/ailf/tmp/tcl8.4.14/generic -DEXP_VERSION=\"5.43.0\" -DSCRIPTDIR=\"/opt/lf/expect/lib/expect5.43\" -DEXECSCRIPTDIR=\"/opt/lf/expect/lib/expect5.43\" -DTCL_DEBUGGER -DUSE_NON_CONST -DSTTY_BIN=\"/bin/stty\" -DDFLT_STTY="\"sane\"" exp_command.c
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
对编译好的expect进行安装
root@ip2dbserver # make install
Making binaries in testsuite...
./mkinstalldirs /opt/lf/expect/lib/expect5.43
mkdir /opt/lf/expect
mkdir /opt/lf/expect/lib
mkdir /opt/lf/expect/lib/expect5.43
if [ -s libexpect5.43.a ] ; then \
./install-sh -c -m 644 libexpect5.43.a /opt/lf/expect/lib/expect5.43/libexpect5.43.a ; \
ranlib /opt/lf/expect/lib/expect5.43/libexpect5.43.a ; \
./install-sh -c -m 644 libexpect5.43.a /opt/lf/expect/lib/libexpect5.43.a ; \
ranlib /opt/lf/expect/lib/libexpect5.43.a ; \
else true; fi
if [ -s reconfigure_Tcl_for_shared_library ] ; then \
./install-sh -c reconfigure_Tcl_for_shared_library /opt/lf/expect/lib/reconfigure_Tcl_for_shared_library ; \
./install-sh -c pkgIndex /opt/lf/expect/lib/expect5.43/pkgIndex.tcl ; \
else true; fi
gcc -pipe -o expect_installed exp_main_exp.o -L/opt/lf/expect/lib -lexpect5.43 -L/opt/lf/tcl/lib -ltcl8.4 -ldl -lsocket -lnsl -lm -Wl,-R,/opt/lf/expect/lib:/opt/lf/tcl/lib
: expect_installed
TCL_LIBRARY=/opt/ailf/tmp/tcl8.4.14/library ; \
export TCL_LIBRARY ; \
LD_LIBRARY_PATH=.:/opt/lf/tcl/lib:/opt/lf/expect/lib:$LD_LIBRARY_PATH ./expect ./fixline1 /opt/lf/expect/bin < ./example/timed-run > timed-run
TCL_LIBRARY=/opt/ailf/tmp/tcl8.4.14/library ; \
export TCL_LIBRARY ; \
LD_LIBRARY_PATH=.:/opt/lf/tcl/lib:/opt/lf/expect/lib:$LD_LIBRARY_PATH ./expect ./fixline1 /opt/lf/expect/bin < ./example/timed-read > timed-read
TCL_LIBRARY=/opt/ailf/tmp/tcl8.4.14/library ; \
export TCL_LIBRARY ; \
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
查看刚才安装的/opt/lf/expect是否成功
root@ip2dbserver # cd /opt/lf/
root@ip2dbserver # ls
cvs expect tcl
root@ip2dbserver # cd expect
root@ip2dbserver # ls
bin include lib man
root@ip2dbserver # pwd
/opt/lf/expect
添加配置文件的路径
root@ip2dbserver # vi /.profile
试试刚刚安装的expect的程序是否成功,可以生成script.exp
root@ip2dbserver # expect -v
expect version 5.43.0
root@ip2dbserver # autopasswd
spawn passwd
请输入用户名: ^Croot@ip2dbserver #
root@ip2dbserver # autoexpect
autoexpect started, file is script.exp
root@ip2dbserver # exit
autoexpect done, file is script.exp
root@ip2dbserver # ls
bin data1 data4 devices home lost+found net proc tmp vol
cdrom data2 data5 etc kernel mnt opt
root@ip2dbserver # rm script.exp
终于安装好了EXPECT了
sohu2000000 回复于:2007-05-17 10:58:21
[size=3][align=center][font=黑体][原创]RANCID完全安装实录(续)[/font][/align][/size]
还剩下一个比较让人头疼的软件CVS,努把力,安装上它
安装CVS,我这里使用的源文件包是:cvs-1.12.13.tar.gz
重命名cvs的源文件的压缩包为正确的格式
root@ip2dbserver # mv cvs-1.12.13.tar.tar cvs-1.12.13.tar.gz
解压cvs的源文件
root@ip2dbserver # gunzip cvs-1.12.13.tar.gz
root@ip2dbserver # tar xvf cvs-1.12.13.tar
x cvs-1.12.13, 0 bytes, 0磁带块
x cvs-1.12.13/build-aux, 0 bytes, 0磁带块
x cvs-1.12.13/build-aux/compile, 3703 bytes, 8磁带块
x cvs-1.12.13/build-aux/config.guess, 42037 bytes, 83磁带块
x cvs-1.12.13/build-aux/config.rpath, 14869 bytes, 30磁带块
x cvs-1.12.13/build-aux/config.sub, 30221 bytes, 60磁带块
x cvs-1.12.13/build-aux/depcomp, 15868 bytes, 31磁带块
x cvs-1.12.13/build-aux/install-sh, 9233 bytes, 19磁带块
x cvs-1.12.13/build-aux/mdate-sh, 5225 bytes, 11磁带块
x cvs-1.12.13/build-aux/missing, 10872 bytes, 22磁带块
x cvs-1.12.13/build-aux/texinfo.tex, 226845 bytes, 444磁带块
x cvs-1.12.13/build-aux/ylwrap, 6187 bytes, 13磁带块
x cvs-1.12.13/contrib, 0 bytes, 0磁带块
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
进入源文件的解压缩目录:
root@ip2dbserver # cd cvs-1.12.13
root@ip2dbserver # ls
ABOUT-NLS ChangeLog.zoo Makefile.am TESTS configure cvsnt.dep emx os2
AUTHORS DEVEL-CVS Makefile.in TODO configure.in cvsnt.dsp lib src
BUGS FAQ NEWS aclocal.m4 contrib cvsnt.dsw m4 tools
COPYING HACKING PROJECTS build-aux cvs-format.el cvsnt.mak maint-aux vms
COPYING.LIB INSTALL README build.com cvs.spec diff man windows-NT
ChangeLog MINOR-BUGS README.VMS config.h.in cvs.spec.in doc mktemp.sh zlib
查看配置选项有哪些
root@ip2dbserver # ./configure --help
/*
`configure‘ configures Concurrent Versions System (CVS) 1.12.13 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking...‘ messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for `--cache-file=config.cache‘
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or `..‘]
…………………………………………………………………………………………..
编译配置CVS
root@ip2dbserver # ./configure --prefix=/opt/lf/cvs --enable-client
checking for a BSD-compatible install... build-aux/install-sh -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
编译CVS
root@ip2dbserver # make
make all-recursive
Making all in lib
cp ./alloca_.h alloca.h-t
mv alloca.h-t alloca.h
cp ./getopt_.h getopt.h-t
mv getopt.h-t getopt.h
cp ./glob_.h glob.h-t
mv glob.h-t glob.h
sed -e ‘s/@‘‘HAVE_LONG_64BIT‘‘@/0/g;s/@‘‘HAVE_LONG_LONG_64BIT@/1/g‘ < ./stdint_.h > stdint.h-t
mv stdint.h-t stdint.h
make all-am
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -Ino/include -g -O2 -MT sighandle.o -MD -MP -MF ".deps/sighandle.Tpo" -c -o sighandle.o sighandle.c; \
then mv -f ".deps/sighandle.Tpo" ".deps/sighandle.Po"; else rm -f ".deps/sighandle.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -Ino/include -g -O2 -MT allocsa.o -MD -MP -MF ".deps/allocsa.Tpo" -c -o allocsa.o allocsa.c; \
then mv -f ".deps/allocsa.Tpo" ".deps/allocsa.Po"; else rm -f ".deps/allocsa.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -Ino/include -g -O2 -MT cycle-check.o -MD -MP -MF ".deps/cycle-check.Tpo" -c -o cycle-check.o cycle-check.c; \
then mv -f ".deps/cycle-check.Tpo" ".deps/cycle-check.Po"; else rm -f ".deps/cycle-check.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -Ino/include -g -O2 -MT basename.o -MD -MP -MF ".deps/basename.Tpo" -c -o basename.o basename.c; \
then mv -f ".deps/basename.Tpo" ".deps/basename.Po"; else rm -f ".deps/basename.Tpo"; exit 1; fi
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
安装编译好的文件
root@ip2dbserver # make install
Making install in lib
make install-am
Making install in zlib
Making install in diff
。。。。。。。。。。。。。。。。。。。。。。。
查看cvs是否安装成功
root@ip2dbserver # cd /opt/lf/
root@ip2dbserver # ls
cvs expect tcl
root@ip2dbserver # cd cvs/
root@ip2dbserver # ls
bin info man share
更改个人系统配置,是刚刚安装的CVS生效
root@ip2dbserver # vi /.profile
下面的一步工作比较繁琐,就是配置安装好的CVS,是它生效:
更改系统配置文件/etc/services,加入:
cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations
root@ip2dbserver # vi /etc/services
更改系统文件
# Asiainfo liufeng CVS
cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations
"/etc/services" 135 行,4488 字符
更改系统配置文件/etc/inetd.conf,加入:
cvspserver stream tcp nowait root /opt/lf/cvs/bin/cvs cvs -f --allow-root=/opt/lf/repository pserver
root@ip2dbserver # vi /etc/inetd.conf
更改系统文件
# ASIAINFO Liufeng CVS
#pserver stream tcp nowait root /opt/lf/cvs cvs --allow-root=/your/path/for/cvs/repository pserver
"/etc/inetd.conf" 163 行,7163 字符
添加cvs用户和用户组cvsadm
root@ip2dbserver # useradd -u 666 -g 666 -d /opt/lf/repository -m cvsadm
UX: useradd: ERROR: group 666 does not exist. Choose another.
root@ip2dbserver # useradd -u 6666 -g 6666 -d /opt/lf/repository -m cvsadm
64 块
root@ip2dbserver # passwd cvsadm
新口令:
请重新输入新口令:
passwd:cvsadm 的口令已成功更改
把CVS的安装目录用户和用户组更改成:cvsadm:cvsadm
root@ip2dbserver # chown -R cvsadm:cvsadm /opt/lf/cvs
重新启动系统的网络服务,使网络服务CVS生效
root@ip2dbserver # ps -ef | grep inetd
root@ip2dbserver # kill -1 174
查看网络服务是否启动
root@ip2dbserver # netstat -an | grep 2401
*.2401 *.* 0 0 49152 0 LISTEN
可以看到服务已经启动了,2041端口正在侦听
下面用cvsadm用户登录系统
修改登录配置,设置CVSROOT 为 CVSROOT=:pserver:cvsadm@**.**.**.**:/opt/lf/repository
root@ip2dbserver # su - cvsadm
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
$ ls
local.cshrc local.login local.profile
$ bash
bash-2.05$ vi .profile
修改登录配置
CVSROOT=:pserver:cvsadm@210.53.130.211:/opt/lf/repository
".profile" 22 行,616 字符
退出重新登录系统,是配置生效
bash-2.05$ exit
exit
$ exit
root@ip2dbserver # su - cvsadm
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
$ ls
local.cshrc local.login local.profile
查看配置是否生效
bash-2.05$ set
BASH=/usr/bin/bash
BASH_VERSINFO=([0]="2" [1]="05" [2]="0" [3]="1" [4]="release" [5]="sparc-sun-solaris2.9")
BASH_VERSION=$‘2.05.0(1)-release‘
COLUMNS=125
CVS=/opt/lf/cvs
CVSROOT=:pserver:cvsadm@210.53.130.211:/opt/lf/repository
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
_=/etc/inetd.conf
可以看到配置已经生效了
登录CVS服务器
bash-2.05$ cvs login
Logging in to :pserver:cvsadm@210.53.130.211:2401/opt/lf/repository
CVS password:
登录成功,初始化cvs服务器
bash-2.05$ ls
local.cshrc local.login local.profile
bash-2.05$ cvs init
bash-2.05$ ls
CVSROOT local.cshrc local.login local.profile
CVS服务器初始化成功
sohu2000000 回复于:2007-05-17 11:00:51
[size=3][font=黑体][align=center][原创]RANCID完全安装实录(续)[/align][/font][/size]
终于搞定了,下面就要开始正式安装RANCID了
安装RANCID,我这里使用的源文件安装包是rancid-2.3.2a6.tar.gz
下面是安装的步骤:
解压源文件包
root@ip2dbserver # tar xvf rancid-2.3.2a6.tar
x rancid-2.3.2a6/README, 12137 bytes, 24磁带块
x rancid-2.3.2a6/acinclude.m4, 41 bytes, 1磁带块
x rancid-2.3.2a6/configure.in, 13019 bytes, 26磁带块
x rancid-2.3.2a6/aclocal.m4, 32562 bytes, 64磁带块
x rancid-2.3.2a6/Makefile.am, 1755 bytes, 4磁带块
x rancid-2.3.2a6/Makefile.in, 20695 bytes, 41磁带块
x rancid-2.3.2a6/configure, 255014 bytes, 499磁带块
x rancid-2.3.2a6/COPYING, 968 bytes, 2磁带块
x rancid-2.3.2a6/depcomp, 17574 bytes, 35磁带块
x rancid-2.3.2a6/install-sh, 13184 bytes, 26磁带块
x rancid-2.3.2a6/missing, 11135 bytes, 22磁带块
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
进入源文件目录
root@ip2dbserver # cd rancid-2.3.2a6
root@ip2dbserver # ls
BUGS Makefile.am Todo bin depcomp man
CHANGES Makefile.in UPGRADING cloginrc.sample etc missing
COPYING README acinclude.m4 configure include mkinstalldirs
FAQ README.lg aclocal.m4 configure.in install-sh share
配置源文件,指定安装目录是/opt/lf/rancid
root@ip2dbserver # ./configure --prefix=/opt/lf/rancid
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for gmake... no
checking for make... /usr/ccs/bin/make
checking whether /usr/ccs/bin/make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
。。。。。。。。。。。。。。。。。。。。。。。。。。。。
编译源文件
root@ip2dbserver # make
Making all in .
Making all in include
/usr/ccs/bin/make all-am
Making all in etc
rm -f lg.conf.sample lg.conf.sample.tmp; \
sed -e ‘s,@bindir\@,/opt/lf/rancid/bin,g‘ -e ‘s,@prefix\@,/opt/lf/rancid,g‘ -e ‘s,@localstatedir\@,/opt/lf/rancid/var,g‘ -e ‘s,@sysconfdir\@,/opt/lf/rancid/etc,g‘ -e ‘s,@EXPECT_PATH\@,/opt/lf/expect/bin/expect,g‘ -e ‘s,@PERLV_PATH\@,/usr/bin/perl,g‘ -e ‘s,@ENV_PATH\@,/usr/bin:/opt/lf/expect/bin:/usr/lib:/opt/lf:/usr/xpg4/bin:/usr/local/bin:/usr/bin,g‘ -e ‘s,@RCSSYS\@,cvs,g‘ -e ‘s,@PACKAGE\@,rancid,g‘ -e ‘s,@VERSION\@,2.3.2a6,g‘ ./lg.conf.sample.in >lg.conf.sample.tmp; \
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
安装编译好的文件
root@ip2dbserver # make install
Making install in .
test -z "/opt/lf/rancid/share/rancid" || ./install-sh -c -d "/opt/lf/rancid/share/rancid"
./install-sh -c -m 644 ‘COPYING‘ ‘/opt/lf/rancid/share/rancid/COPYING‘
./install-sh -c -m 644 ‘CHANGES‘ ‘/opt/lf/rancid/share/rancid/CHANGES‘
./install-sh -c -m 644 ‘FAQ‘ ‘/opt/lf/rancid/share/rancid/FAQ‘
./install-sh -c -m 644 ‘README‘ ‘/opt/lf/rancid/share/rancid/README‘
./install-sh -c -m 644 ‘README.lg‘ ‘/opt/lf/rancid/share/rancid/README.lg‘
./install-sh -c -m 644 ‘UPGRADING‘ ‘/opt/lf/rancid/share/rancid/UPGRADING‘
./install-sh -c -m 644 ‘cloginrc.sample‘ ‘/opt/lf/rancid/share/rancid/cloginrc.sample‘
/usr/ccs/bin/make install-data-hook
/bin/bash ./mkinstalldirs /opt/lf/rancid /opt/lf/rancid/etc /opt/lf/rancid/var;
mkdir /opt/lf/rancid/etc
。。。。。。。。。。。。。。。。。。。。
查看安装是否成功
root@ip2dbserver # cd /opt/lf
root@ip2dbserver # ls
cvs expect rancid tcl
root@ip2dbserver # cd rancid
root@ip2dbserver # ls
bin etc share var
可以看到安装成功了,更改登录文件,以便是安装的文件目录生效
root@ip2dbserver # vi /.profile
原文地址:http://7474112.blog.51cto.com/7464112/1825965