LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: fiddle

完了,上不了网:( --- 已解决:)

[复制链接]
 楼主| 发表于 2005-7-30 02:32:54 | 显示全部楼层

找到一点眉目了,但还是不清楚

按照kite兄的提示,在console下:
root@fiddle:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
但是小弟网络基础基本为0,不太了解这对不对,但是发现了另外一个问题,在/etc/rc.d/下,有一些.new文件:
root@fiddle:/etc/rc.d# ls -al
total 272
drwxr-xr-x   2 root root  4096 2005-07-28 07:35 ./
drwxr-xr-x  49 root root  4096 2005-07-30 01:12 ../
lrwxrwxrwx   1 root root     4 2005-07-28 03:00 rc.0 -> rc.6*
-rwxr-xr-x   1 root root   893 2003-01-30 05:43 rc.4*
-rwxr-xr-x   1 root root  5522 2004-10-19 10:10 rc.6*
-rwxr-xr-x   1 root root  1989 2004-06-21 22:04 rc.K*
-rwxr-xr-x   1 root root  7855 2004-10-19 10:10 rc.M*
-rwxr-xr-x   1 root root  8144 2005-07-25 07:00 rc.M.new*
-rwxr-xr-x   1 root root 10784 2004-10-19 09:55 rc.S*
-rwxr-xr-x   1 root root 10819 2005-07-18 07:45 rc.S.new*
-rwxr-xr-x   1 root root   466 2004-11-05 16:20 rc.acpid*
-rwxr-xr-x   1 root root  1650 2005-07-23 02:41 rc.alsa*
-rw-r--r--   1 root root  1032 2003-02-02 11:47 rc.atalk
-rw-r--r--   1 root root  1031 2003-09-22 03:07 rc.bind
-rw-r--r--   1 root root  3942 2005-01-05 10:13 rc.cups
-rw-r--r--   1 root root   512 2005-01-24 05:38 rc.dnsmasq
-rwxr-xr-x   1 root root   119 2004-05-30 12:19 rc.font.new*
-rwxr-xr-x   1 root root  1156 2005-07-21 09:00 rc.gpm*
-rwxr-xr-x   1 root root  1523 2005-07-25 05:23 rc.hotplug*
-rw-r--r--   1 root root   401 2003-03-06 05:28 rc.httpd
-rwxr-xr-x   1 root root  5774 2004-06-07 14:42 rc.inet1*
-rw-r--r--   1 root root  3438 2005-07-30 00:29 rc.inet1.conf
-rw-r--r--   1 root root  3401 2005-07-25 04:50 rc.inet1.conf.new
-rwxr-xr-x   1 root root  8071 2005-07-25 04:50 rc.inet1.new*
-rwxr-xr-x   1 root root  4583 2004-06-07 14:08 rc.inet2*
-rwxr-xr-x   1 root root  5267 2005-07-25 05:01 rc.inet2.new*
-rwxr-xr-x   1 root root   497 2003-09-12 11:27 rc.inetd*
-rw-r--r--   1 root root  1924 2003-09-14 07:10 rc.ip_forward
-rwxr-xr-x   1 root root   113 1995-10-03 07:54 rc.local*
-rwxr-xr-x   1 root root 25400 2005-01-21 12:28 rc.modules*
-rw-r--r--   1 root root  2260 2005-01-26 03:47 rc.mysqld
-rw-r--r--   1 root root  2300 2005-07-23 03:32 rc.mysqld.new
-rwxr-xr-x   1 root root  2389 2004-06-07 05:52 rc.nfsd*
-rw-r--r--   1 root root  4790 2004-10-28 13:30 rc.pcmcia
-rw-r--r--   1 root root   905 2003-09-14 07:38 rc.portmap
-rw-r--r--   1 root root   791 2004-12-20 13:27 rc.samba
-rw-r--r--   1 root root  1169 2005-07-25 08:11 rc.saslauthd
-rwxr-xr-x   1 root root   687 2002-06-05 05:09 rc.sendmail*
-rwxr-xr-x   1 root root  2895 2005-01-02 10:55 rc.serial*
-rwxr-xr-x   1 root root  1222 2005-06-12 13:30 rc.sshd*
-rwxr-xr-x   1 root root   860 2004-05-03 06:07 rc.syslog*
-rwxr-xr-x   1 root root  1740 1999-09-12 04:48 rc.sysvinit*
-rwxr-xr-x   1 root root  1396 2005-01-15 08:30 rc.udev*
-rwxr-xr-x   1 root root  8293 2005-07-25 15:19 rc.wireless*
-rw-------   1 root root  6177 2004-06-07 15:22 rc.wireless.conf
-rw-------   1 root root  7320 2005-07-25 15:19 rc.wireless.conf.new
-rwxr-xr-x   1 root root  2323 2004-06-06 08:47 rc.yp*

比较了一下rc.inet1和rc.inet1.new,有不同,于是运行rc.inet1.new:
root@fiddle:/etc/rc.d# ./rc.inet1.new
之后,再次运行route:
root@fiddle:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
default         192.168.1.1     0.0.0.0         UG    1      0        0 eth0
明显和刚才不一样,ping了一下新浪,果然通了。

现在问题是这些.new文件谁产生的,是swaret升级后产生的么?我现在需要把它们全部覆盖原来的非.new文件么?包括rc.M.new么?
还有那个route的输出对不对?哪位大哥给解释一下?
回复 支持 反对

使用道具 举报

发表于 2005-7-30 08:46:21 | 显示全部楼层
不知道slack像不像debian一样,更新时有选择使用新配置还是旧配置
如果有,应该是楼主选择了新配置
回复 支持 反对

使用道具 举报

发表于 2005-7-30 09:00:35 | 显示全部楼层
doinst.sh中有个config()用来处理配置文件,通过md5校验,判断配置文件是否相同,如果相同则覆盖,如果不同则新的配置文件保留.new的后缀,留待管理员决定。

  1. config() {
  2.   NEW="$1"
  3.   OLD="`dirname $NEW`/`basename $NEW .new`"
  4.   # If there's no config file by that name, mv it over:
  5.   if [ ! -r $OLD ]; then
  6.     mv $NEW $OLD
  7.   elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
  8.     rm $NEW
  9.   fi
  10.   # Otherwise, we leave the .new copy for the admin to consider...
  11. }
复制代码


你如果认为配置文件需要升级,那直接mv xxx.conf.new xxx.conf就可以了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-30 09:30:38 | 显示全部楼层
Post by troll
doinst.sh中有个config()用来处理配置文件,通过md5校验,判断配置文件是否相同,如果相同则覆盖,如果不同则新的配置文件保留.new的后缀,留待管理员决定。

  1. config() {
  2.   NEW="$1"
  3.   OLD="`dirname $NEW`/`basename $NEW .new`"
  4.   # If there's no config file by that name, mv it over:
  5.   if [ ! -r $OLD ]; then
  6.     mv $NEW $OLD
  7.   elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
  8.     rm $NEW
  9.   fi
  10.   # Otherwise, we leave the .new copy for the admin to consider...
  11. }
复制代码


你如果认为配置文件需要升级,那直接mv xxx.conf.new xxx.conf就可以了。

已经mv过了,但是还是不行,我必须手动执行/etc/rc.d/rc.inet1,否则还是找补到网络。在/etc/rc.d/rc.M中明明有:
if [ -x /etc/rc.d/rc.inet1 ]; then
  . /etc/rc.d/rc.inet1
fi

这是怎么回事呀?
回复 支持 反对

使用道具 举报

发表于 2005-7-30 10:02:33 | 显示全部楼层
试试指令"route add default gw 192.168.1.1"
回复 支持 反对

使用道具 举报

发表于 2005-7-30 10:04:01 | 显示全部楼层
chmod +x  /etc/rc.d/rc.inet1
回复 支持 反对

使用道具 举报

发表于 2005-7-30 10:30:14 | 显示全部楼层
不是这个问题,有可能是没有来得及加载模块,你hotplug有没有升级?手动在rc.modules中添上网卡的模块试试看。
回复 支持 反对

使用道具 举报

发表于 2005-7-30 11:35:18 | 显示全部楼层
将lsmod和lspci列出
从你列出的route结果应是未加上网关,用liquid_zigong的方法
route add default gw 192.168.1.1
如果还不行就全手动设置,手动设置正常才有可能自动设置正常。
ifconfig ethX down        #ethx 为你要设置的网卡,一般为0
ifconfig ethx 192.168.1.xxx     #xxx 为你要的ip
route add default gw 192.168.1.1
echo "nameserver 192.168.1.1">/etc/resolv.conf
回复 支持 反对

使用道具 举报

发表于 2005-7-30 11:56:29 | 显示全部楼层
请升级到Current中最新的tcpip包。
回复 支持 反对

使用道具 举报

发表于 2005-7-30 16:00:00 | 显示全部楼层
列出/etc/rc.d/rc.inet1.conf
看看里面是否将USE_DHCP[x]=yes   #x 为网卡号, 如果此参数设为yes, 机器将不执行rc.inet1.conf
再将/etc/dhcpc/中除dhcpcd-ethx.exe外的文件都删除后,重新启动机器后,会自动设置网格
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表