【 以下文字转载自 cnAdmin 讨论区 】
【 原文由 jjksam 所发表 】
先要多谢Czz跟ELM两位大虾的指点。:-)
今天终于解决了在freebsd下面innbbsd的安装问题。
症状如下:
在FreeBSD4.2下面编译
Makefile其中一部分如下
# Generated automatically from Makefile.in by configure.
# Makefile of innbbsd for Firebird BBS 3.0
#
# $Id: Makefile.in,v 1.12 2000/07/25 09:14:01 edwardc Exp $
##########################################################
VERSION = 0.50beta-5F
NCMVERSION = NoCeM_0.66
ADMINUSER = SYSOP.bbs@bbs.szu.edu.cn
BBSHOME = /home/bbs
BBSHOST = bbs.szu.edu.cn
BBS_SRC = /root/src/bbssrc
PERL = /usr/bin/perl
LANG = GB
-------------------------------------------------------
#make freebsd && make install
接着设置bbsname.bbs newsfeeds.bbs nodelist.bbs
# su bbs
$ /home/bbs/innd/innbbsd
su-2.04$ /home/bbs/innd/innbbsd
su-2.04$ PID file is in /usr/tmp/innbbsd-7777.pid
Try to listen in port (null) and path (null)
Trying to listen in port 1904
Trying to listen in port .innbbsd1
bind: Address already in use
.innbbsd1: Address already in use
Trying to listen in port .innbbsd2
.innbbsd2/tcp: Unknown service.
local pmain, existing: Address already in use
if no other innbbsd running, try to remove (null)
或者出现跟这个类似的信息
%PID file is in /usr/tmp/innbbsd-7777.pid
Try to listen in port (null) and path (null)
Trying to listen in port 1904
Trying to listen in port .innbbsd1
bind: Permission denied
.innbbsd1: Permission denied
~~~~~~~~~~~~~~~~~~就这个不同
Trying to listen in port .innbbsd2
.innbbsd2/tcp: Unknown service.
local pmain, existing: Permission denied
if no other innbbsd running, try to remove (null)
但是在Redhat 6.2下面编译后运行就没问题。
[bbs@fly innd]$ PID file is in /usr/tmp/innbbsd-7777.pid
Try to listen in port 7777 and path /home/bbs/innd/.innbbsd
[bbs@fly innbbsd]$ telnet localhost 7777
Trying 127.0.0.1...
Connected to fly.szu.edu.cn.
Escape character is '^]'.
200 flyBBS InterNetNews INNBBSD server 0.50beta-5F_NoCeM_0.63
(bbs@fly.szu.edu.cn).
quit
[bbs@fly innd]$
说明是freebsd自己的问题。
再继续追查原因。用暴力法把那个端口也改了,还是不行。
分析下面这段错误信息:
su-2.04$ /home/bbs/innd/innbbsd
su-2.04$ PID file is in /usr/tmp/innbbsd-7777.pid
~~~~这里表明port还是用默认的7777
Try to listen in port (null) and path (null)
~~~~~~~ ~~~~~~但这两个就变了。
Trying to listen in port 1904
[bbs /root/src/bbssrc/util/innbbsd]# grep "Try to listen in port" *
dbzserver.c: fprintf(stderr, "Try to listen in port %s and path
%s\n",
port, path);
inndchannel.c: fprintf(stderr, "Try to listen in port %s and path
%s\n",
port, path);
找到两个地方。我想,既然不知道port跟path在什么时候被改变了,那不如加一个
static看看怎样吧。
就在main函数开始那里有port跟path的定义:
main(argc, argv)
int argc;
char **argv;
{
static char *port, *path;/* 加一个static的声明 */
int c, errflag = 0;
extern INNBBSDhalt();
#if !defined(DBZSERVER)
initial_lang();
#endif
重新make
运行innbbsd
PID file is in /usr/tmp/innbbsd-7777.pid
Try to listen in port 7777 and path /home/bbs/innd/.innbbsd
噢。。终于行了,
#telnet localhost 7777
Trying 127.0.0.1...
Connected to localhost.szu.edu.cn.
Escape character is '^]'.
502 You are not in my access file. (unknown@localhost.szu.edu.cn)
Connection closed by foreign host.
那两个指针具体在哪里被改变就不清楚了,反正加了static就没事。希望这些能对遇到同
类问题的人有所帮助。:)
--
FROM 192.168.0.234