wicd - 启动后无连接,必须手动重新启动?

wicd - 启动后无连接,必须手动重新启动?

我正在使用版本 1.7.1_pre20120127 和 python 2.7.2:

[U] net-misc/wicd
     Available versions:  1.7.0 (~)1.7.0-r1 1.7.1_beta2-r4 (~)1.7.1_pre20111210-r1 1.7.1_pre20120127 (~)1.7.1_pre20120127-r1 (~)1.7.1 (~)1.7.1-r1 {X ambiance +gtk ioctl libnotify mac4lin ncurses nls +pm-utils}
     Installed versions:  1.7.1_pre20120127(01:42:42 PM 02/29/2012)(X gtk libnotify ncurses nls pm-utils -ioctl -mac4lin)
     Homepage:            http://wicd.sourceforge.net/
     Description:         A lightweight wired and wireless network manager for Linux

如果我将 wicd 添加到defaults运行级别,它总是在启动后要求输入 root 密码。但如果我将其添加到boot运行级别,则没有连接(有线和无线):

2012/02/29 21:13:36 :: Using wired interface...eth0
2012/02/29 21:13:41 :: Autoconnecting...
2012/02/29 21:13:41 :: Attempting to autoconnect with wired interface...
2012/02/29 21:13:41 :: Putting interface down
2012/02/29 21:13:41 :: Releasing DHCP leases...
2012/02/29 21:13:41 :: Setting false IP...
2012/02/29 21:13:41 :: Flushing the routing table...
2012/02/29 21:13:41 :: Putting interface up...
2012/02/29 21:13:44 :: Running DHCP with hostname gentoo
2012/02/29 21:13:44 :: dhcpcd[2699]: version 5.2.12 starting
2012/02/29 21:13:44 ::
2012/02/29 21:13:44 :: /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf: line 64: /etc/resolv.conf: Permission denied
2012/02/29 21:13:44 ::
2012/02/29 21:13:44 :: chmod: changing permissions of `/etc/resolv.conf': Operation not permitted
2012/02/29 21:13:44 ::
2012/02/29 21:13:44 :: dhcpcd[2699]: eth0: broadcasting for a lease
2012/02/29 21:13:44 ::
2012/02/29 21:13:44 :: dhcpcd[2699]: eth0: offered 192.168.15.36 from 192.168.15.1
2012/02/29 21:13:44 ::
2012/02/29 21:13:44 :: dhcpcd[2699]: eth0: acknowledged 192.168.15.36 from 192.168.15.1
2012/02/29 21:13:44 ::
2012/02/29 21:13:44 :: dhcpcd[2699]: eth0: checking for 192.168.15.36
2012/02/29 21:13:44 ::
2012/02/29 14:13:48 :: dhcpcd[2699]: eth0: leased 192.168.15.36 for 600 seconds
2012/02/29 14:13:48 ::
2012/02/29 14:13:48 :: /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf: line 64: /etc/resolv.conf: Permission denied
2012/02/29 14:13:48 ::
2012/02/29 14:13:48 :: chmod: changing permissions of `/etc/resolv.conf': Operation not permitted
2012/02/29 14:13:48 ::
2012/02/29 14:13:48 :: dhcpcd[2699]: forked to background, child pid 2769
2012/02/29 14:13:48 ::
2012/02/29 14:13:48 ::
2012/02/29 14:13:48 :: DHCP connection successful
2012/02/29 14:13:48 :: Connecting thread exiting.
2012/02/29 14:13:49 :: No wired connection present, attempting to autoconnect to wireless network 

您会看到“权限被拒绝”错误,因为我标记/etc/resolv.conf为不可变。注意最后一行。

这是手动重新启动 wicd 时的日志:

2012/02/29 14:15:37 :: Using wired interface...eth0
2012/02/29 14:15:43 :: Autoconnecting...
2012/02/29 14:15:43 :: Putting interface downAttempting to autoconnect with wired interface...
2012/02/29 14:15:43 ::
2012/02/29 14:15:43 :: Releasing DHCP leases...
2012/02/29 14:15:43 :: Setting false IP...
2012/02/29 14:15:43 :: Flushing the routing table...
2012/02/29 14:15:43 :: Putting interface up...
2012/02/29 14:15:45 :: Running DHCP with hostname gentoo
2012/02/29 14:15:45 :: dhcpcd[3471]: version 5.2.12 starting
2012/02/29 14:15:45 ::
2012/02/29 14:15:45 :: /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf: line 64: /etc/resolv.conf: Permission denied
2012/02/29 14:15:45 ::
2012/02/29 14:15:45 :: chmod: changing permissions of `/etc/resolv.conf': Operation not permitted
2012/02/29 14:15:45 ::
2012/02/29 14:15:45 :: dhcpcd[3471]: eth0: broadcasting for a lease
2012/02/29 14:15:45 ::
2012/02/29 14:15:50 :: dhcpcd[3471]: eth0: offered 192.168.15.36 from 192.168.15.1
2012/02/29 14:15:50 ::
2012/02/29 14:15:50 :: dhcpcd[3471]: eth0: acknowledged 192.168.15.36 from 192.168.15.1
2012/02/29 14:15:50 ::
2012/02/29 14:15:50 :: dhcpcd[3471]: eth0: checking for 192.168.15.36
2012/02/29 14:15:50 ::
2012/02/29 14:15:56 :: dhcpcd[3471]: eth0: leased 192.168.15.36 for 600 seconds
2012/02/29 14:15:56 ::
2012/02/29 14:15:56 :: /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf: line 64: /etc/resolv.conf: Permission denied
2012/02/29 14:15:56 ::
2012/02/29 14:15:56 :: chmod: changing permissions of `/etc/resolv.conf': Operation not permitted
2012/02/29 14:15:56 ::
2012/02/29 14:15:56 :: dhcpcd[3471]: forked to background, child pid 3502
2012/02/29 14:15:56 ::
2012/02/29 14:15:56 ::
2012/02/29 14:15:56 :: DHCP connection successful
2012/02/29 14:15:56 :: Connecting thread exiting.
2012/02/29 14:16:00 :: Sending connection attempt result success

这个问题类似于:https://bbs.archlinux.org/viewtopic.php?id=121589,但硬件时钟是正确的,我找不到任何与ntpdatein相关的脚本/etc/wicd/scripts/postconnect/

有任何想法吗?


更新: 3 月 2 日星期五 16:36:12 ICT 2012

dhcpcd并且wpa_supplicant已经从运行级别中删除default

gentoo ~ # rc-update -v show | grep dhcpcd
               dhcpcd |                                 
gentoo ~ # rc-update -v show | grep wpa
       wpa_supplicant |              

net.eth0被删除:

gentoo ~ # rc-update -v show | grep eth0
             net.eth0 |            

回复凯尔·琼斯:

要检查您的配置是否与硬件时钟的设置不一致,请运行

date; /sbin/hwclock --show
# date; hwclock --show
Sun Mar  4 11:41:53 ICT 2012
Sun 04 Mar 2012 11:41:54 AM ICT  -0.697282 seconds

# grep -v ^# /etc/conf.d/hwclock | sed '/^[ \t]*$/d'
clock="UTC"
clock_systohc="NO"
clock_hctosys="NO"
clock_args=""

更新 3 月 6 日星期二 09:49:14 ICT 2012

今天,日志显示“成功”,但wicd无法连接到任何网络:

Putting interface up...
Running DHCP with hostname gentoo
dhcpcd[5063]: version 5.2.12 starting

dhcpcd[5063]: eth0: broadcasting for a lease

dhcpcd[5063]: eth0: offered 192.168.15.36 from 192.168.15.1

dhcpcd[5063]: eth0: acknowledged 192.168.15.36 from 192.168.15.1

dhcpcd[5063]: eth0: checking for 192.168.15.36

dhcpcd[5063]: eth0: leased 192.168.15.36 for 600 seconds

dhcpcd[5063]: forked to background, child pid 5094


DHCP connection successful
Connecting thread exiting.
Sending connection attempt result success

wicd-gtk显示“未连接”并且eth0没有IP:

eth0      Link encap:Ethernet  HWaddr 00:13:a9:4f:84:44  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1860 errors:0 dropped:2 overruns:0 frame:0
          TX packets:301 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:205470 (200.6 KiB)  TX bytes:34017 (33.2 KiB)
          Interrupt:16 

答案1

您的硬件时钟设置的时区(UTC 或您的本地时区)和您的 Linux 系统配置认为的时区很可能存在不一致。如果它们不同,hwclock则会在系统初始化期间错误地设置系统时钟,稍后当 NTP 守护程序发现您的系统时间与 UTC 相差了您的本地时区的小时数时,它会修复系统时钟。

要检查您的配置是否与硬件时钟的设置不一致,请运行

date; /sbin/hwclock --show

如果显示的时间相隔数小时,则说明您的配置与硬件时钟设置不匹配。我不熟悉 Gentoo 配置的工作原理,但在其他一些 Linux 发行版上,您可以编辑 /etc/sysconfig/clock 并设置UTC=trueUTC=false取决于您的硬件时钟是否设置为 UTC。我认为您的硬件时钟设置为您当地的时区,所以您需要UTC=false.

答案2

问题解决了!罪魁祸首是……hwclock。

正如我上面所说,下面是配置。对于我的时钟:

clock="UTC"
clock_systohc="NO"
clock_hctosys="NO"
clock_args=""

但我有这行(愚蠢的)/etc/local.d/baselayout1.start

hwclock --hctosys

使用此配置,以下是启动后的日期时间:

gentoo ~ # hwclock 
Wed 21 Mar 2012 10:29:57 AM ICT  -0.134053 seconds
gentoo ~ # hwclock --utc
Wed 21 Mar 2012 05:30:01 PM ICT  -0.928500 seconds
gentoo ~ # date
Wed Mar 21 10:30:03 ICT 2012
gentoo ~ # date --utc
Wed Mar 21 03:30:06 UTC 2012

hwclock和输出date是正确的,hwclock --utc比 晚 7 小时, 比date --utc早 7 小时。

删除此行hwclock --hctosys/etc/local.d/baselayout1.start更改clock_systohcclock_hctosys"YES"解决/etc/conf.d/hwclock问题:

gentoo ~ # hwclock 
Wed 21 Mar 2012 03:33:43 AM ICT  -0.404693 seconds
gentoo ~ # hwclock --utc
Wed 21 Mar 2012 10:33:46 AM ICT  -0.418345 seconds
gentoo ~ # date
Wed Mar 21 10:33:48 ICT 2012
gentoo ~ # date --utc
Wed Mar 21 03:33:54 UTC 2012

相关内容