linux下安装启动rpc服务
1.上传包
rocky:~ # ls Desktop dts.xml jdk1.6.0_41 oswbb rpc.rstatd-4.0.1 rpc.rstatd-4.0.1.tar.gz rocky:~ # cd rpc.rstatd-4.0.1 rocky:~/rpc.rstatd-4.0.1 # ls aclocal.m4 config.h configure.in getdata22.c getdata24.h getdata.c install-sh missing rpc.rstatd.8 rstat_main.c rstat_svc.c rsysinfo.1 rup.c AUTHORS config.h.in COPYING getdata22.h getdata26.c getdata.h Makefile.am mkinstalldirs rstat_clnt.c rstat_proc.c rstat.x rsysinfo.c ChangeLog configure depcomp getdata24.c getdata26.h INSTALL Makefile.in README rstatd.8 rstat_proc.h rstat_xdr.c rup.1
2.配置
rocky:~/rpc.rstatd-4.0.1 # ./configure checking for a BSD-compatible install... /bin/install -c checking whether build environment is sane... yes /root/rpc.rstatd-4.0.1/missing: Unknown `--run' option Try `/root/rpc.rstatd-4.0.1/missing --help' for more information configure: WARNING: `missing' script is too old or missing checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for gawk... (cached) gawk 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 checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for a BSD-compatible install... /bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking whether time.h and sys/time.h may both be included... yes checking whether gcc needs -traditional... no checking for ANSI C header files... (cached) yes checking return type of signal handlers... void configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands
3.编译
rocky:~/rpc.rstatd-4.0.1 # make rm -f rstat.h rpcgen -h -o rstat.h rstat.x make all-am make[1]: Entering directory `/root/rpc.rstatd-4.0.1' if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT rup.o -MD -MP -MF ".deps/rup.Tpo" -c -o rup.o rup.c; \ then mv -f ".deps/rup.Tpo" ".deps/rup.Po"; else rm -f ".deps/rup.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT rstat_xdr.o -MD -MP -MF ".deps/rstat_xdr.Tpo" -c -o rstat_xdr.o rstat_xdr.c; \ then mv -f ".deps/rstat_xdr.Tpo" ".deps/rstat_xdr.Po"; else rm -f ".deps/rstat_xdr.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT rstat_clnt.o -MD -MP -MF ".deps/rstat_clnt.Tpo" -c -o rstat_clnt.o rstat_clnt.c; \ then mv -f ".deps/rstat_clnt.Tpo" ".deps/rstat_clnt.Po"; else rm -f ".deps/rstat_clnt.Tpo"; exit 1; fi gcc -g -O2 -o rup rup.o rstat_xdr.o rstat_clnt.o if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT rsysinfo.o -MD -MP -MF ".deps/rsysinfo.Tpo" -c -o rsysinfo.o rsysinfo.c; \ then mv -f ".deps/rsysinfo.Tpo" ".deps/rsysinfo.Po"; else rm -f ".deps/rsysinfo.Tpo"; exit 1; fi gcc -g -O2 -o rsysinfo rsysinfo.o rstat_xdr.o rstat_clnt.o if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT rstat_svc.o -MD -MP -MF ".deps/rstat_svc.Tpo" -c -o rstat_svc.o rstat_svc.c; \ then mv -f ".deps/rstat_svc.Tpo" ".deps/rstat_svc.Po"; else rm -f ".deps/rstat_svc.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT rstat_proc.o -MD -MP -MF ".deps/rstat_proc.Tpo" -c -o rstat_proc.o rstat_proc.c; \ then mv -f ".deps/rstat_proc.Tpo" ".deps/rstat_proc.Po"; else rm -f ".deps/rstat_proc.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT rstat_main.o -MD -MP -MF ".deps/rstat_main.Tpo" -c -o rstat_main.o rstat_main.c; \ then mv -f ".deps/rstat_main.Tpo" ".deps/rstat_main.Po"; else rm -f ".deps/rstat_main.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT getdata.o -MD -MP -MF ".deps/getdata.Tpo" -c -o getdata.o getdata.c; \ then mv -f ".deps/getdata.Tpo" ".deps/getdata.Po"; else rm -f ".deps/getdata.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT getdata22.o -MD -MP -MF ".deps/getdata22.Tpo" -c -o getdata22.o getdata22.c; \ then mv -f ".deps/getdata22.Tpo" ".deps/getdata22.Po"; else rm -f ".deps/getdata22.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT getdata24.o -MD -MP -MF ".deps/getdata24.Tpo" -c -o getdata24.o getdata24.c; \ then mv -f ".deps/getdata24.Tpo" ".deps/getdata24.Po"; else rm -f ".deps/getdata24.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT getdata26.o -MD -MP -MF ".deps/getdata26.Tpo" -c -o getdata26.o getdata26.c; \ then mv -f ".deps/getdata26.Tpo" ".deps/getdata26.Po"; else rm -f ".deps/getdata26.Tpo"; exit 1; fi gcc -g -O2 -o rpc.rstatd rstat_svc.o rstat_xdr.o rstat_proc.o rstat_main.o getdata.o getdata22.o getdata24.o getdata26.o make[1]: Leaving directory `/root/rpc.rstatd-4.0.1'
4.安装
rocky:~/rpc.rstatd-4.0.1 # make install make install-am make[1]: Entering directory `/root/rpc.rstatd-4.0.1' make[2]: Entering directory `/root/rpc.rstatd-4.0.1' test -z "/usr/local/bin" || mkdir -p -- . "/usr/local/bin" /bin/install -c 'rup' '/usr/local/bin/rup' /bin/install -c 'rsysinfo' '/usr/local/bin/rsysinfo' test -z "/usr/local/sbin" || mkdir -p -- . "/usr/local/sbin" /bin/install -c 'rpc.rstatd' '/usr/local/sbin/rpc.rstatd' make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/root/rpc.rstatd-4.0.1' make[1]: Leaving directory `/root/rpc.rstatd-4.0.1'
5.测试
rocky:~/rpc.rstatd-4.0.1 # /usr/local/sbin/rpc.rstatd Cannot register service: RPC: Unable to receive; errno = Connection refused rocky:~/rpc.rstatd-4.0.1 # rocky:~/rpc.rstatd-4.0.1 # /etc/rc.d/init.d/portmap start Starting portmap... rocky:~/rpc.rstatd-4.0.1 # /etc/rc.d/init.d/portmap status portmap is running with Process ID(s) 5069. rocky:~/rpc.rstatd-4.0.1 # /usr/local/sbin/rpc.rstatd rocky:~/rpc.rstatd-4.0.1 #
rpc 包下载 http://pan.baidu.com/s/1mhjHaJI