Python 程序无法在连接外网的情况下启动 redhawksdr 组件

Python program can not launch redhawksdr component with external network connected

我是 RedHawkSDR 的新用户,在 CentOS 下写了一个 python 程序来控制一个 "SigGen" 组件。如果除了环回之外没有网络连接,它可以工作,但如果我连接有线网络(列为系统 ethO),它就会失败。

我在python程序中没有指定任何IP地址,omniORB.cfg明确列出了环回地址,如下所示,因为其他帖子中有评论警告不要使用"localhost"

traceLevel=10
InitRef = NameService=corbaname::127.0.0.1:2809
supportBootstrapAgent = 1
InitRef = EventService=corbaloc::127.0.0.1:11169/omniEvents

比较两种情况下打印到屏幕上的 ominORB 数据:

最后相同的步骤 ==>“omniORB:AsyncInvoker:线程 id=2 已启动。线程总数=1

下一步:

用于工作(无网络)==>“omniORB:添加 root<0>(激活)到对象 table

对于非工作(网络连接)==>“omniORB:从对象table

中删除根<0>(虚化)

网络连接案例的完整消息流==>

[aecom@crancentos1 Desktop]$ python pTrigger.py keyboard 5555 5050
omniORB: Version: 4.1.6
omniORB: Distribution date: Fri Jul  1 15:57:00 BST 2011 dgrisby
omniORB: Information: the omniDynamic library is not linked.
omniORB: omniORBpy distribution date: Fri Jul  1 14:52:31 BST 2011 dgrisby
omniORB: Initialising incoming endpoints.
omniORB: Attempt to set socket to listen on IPv4 and IPv6.
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
/usr/local/redhawk/core/lib/python/ossie/utils/sb/domainless.py:863:
DeprecationWarning: Component class is deprecated. Use launch() method instead.
warnings.warn('Component class is deprecated. Use launch() method instead.', DeprecationWarning)
omniORB: Adding root<0> (activating) to object table.
omniORB: Creating ref to local: root<0>
target id      : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: Creating Python ref to local: root<0>
target id      : IDL:omg.org/CosNaming/NamingContextExt:1.0
most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: Version: 4.1.6
omniORB: Distribution date: Fri Jul  1 15:57:00 BST 2011 dgrisby
omniORB: Information: the omniDynamic library is not linked.
omniORB: omniORBpy distribution date: Fri Jul  1 14:52:31 BST 2011 dgrisby
omniORB: Initialising incoming endpoints.
omniORB: Attempt to set socket to listen on IPv4 and IPv6.
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
omniORB: Removing root<0> (etherealising) from object table
Traceback (most recent call last):
File "pTrigger.py", line 118, in <module>
sigGen=sb.Component("SigGen")
File "/usr/local/redhawk/core/lib/python/ossie/utils/sb/domainless.py", line 872, in __new__
raise AssertionError, "Unable to launch component: '%s'" % e
AssertionError: Unable to launch component: 'resource 'SigGen_2' did not register with virtual environment'

是否有系统variable/token/thing在环回情况下是“127.0.0.1”,当系统建立网络连接时切换到网络IP地址,然后混淆omniORB?

任何建设性指导将不胜感激...

此致,

布拉德迈耶

附加数据 // 防火墙关闭=============================

// 确凿的证据 ?===============================

 omniORB: omniORBpy distribution date: Fri Jul  1 14:52:31 BST 2011 dgrisby
 omniORB: Python thread state scavenger start.
 omniORB: Initialising incoming endpoints.
 omniORB: Instantiate endpoint 'giop:tcp:127.0.0.1:'
 omniORB: Explicit bind to host 127.0.0.1.
 omniORB: Bind to address 127.0.0.1 ephemeral port.
 omniORB: Publish specification: 'addr'
 omniORB: Try to publish 'addr' for endpoint giop:tcp:127.0.0.1:46877
 omniORB: Publish endpoint 'giop:tcp:127.0.0.1:46877'
 omniORB: Starting serving incoming endpoints.
 omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
 omniORB: giopRendezvouser task execute for giop:tcp:127.0.0.1:46877
 ==>omniORB: SocketCollection idle. Sleeping.
 omniORB: State root<0> (active) -> deactivating

// ifconfig 显示环回 运行 ================== Link encap:Local 环回
inet addr:127.0.0.1 Mask:255.0.0.0 inet6 地址:::1/128 Scope:Host 上环回 运行 MTU:65536 Metric:1 RX packets:302 errors:0 dropped:0 overruns:0 frame:0 TX packets:302 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:26197 (25.5 KiB) TX bytes:26197 (25.5 KiB)

// ping 127.0.0.1 有效 ====================================== =====

// netstat -tulpn 显示 OMIN 连接到一些端口================================== ======= 活跃的互联网连接(仅限服务器) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program 名称
tcp 0 0 127.0.0.1:42451 0.0.0.0:* 听 2409/omniEvents
tcp 0 0 为 POST 0.0.0.0 编辑:* LISTEN 2617/dnsmasq
tcp 0 0 0.0.0.0:50517 0.0.0.0:* 收听 2067/rpc.statd
TCP 0 0 0.0.0.0:22 0.0.0.0:* 监听 2254/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* 收听 2098/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2346/master
tcp 0 0 127.0.0.1:42251 0.0.0.0:* 收听 2022/omniNames
tcp 0 0 0.0.0.0:111 0.0.0.0:* 收听 1902/rpcbind
tcp 0 0 :::39409 :::* 收听 2067/rpc.statd
TCP 0 0 :::22 :::* 收听 2254/sshd
tcp 0 0 ::1:631 ::::* 收听 2098/cupsd
tcp 0 0 ::1:25 ::::* LISTEN 2346/master
tcp 0 0 :::2809 :::* 收听 2022/omniNames
tcp 0 0 :::11169 :::* 收听 2409/omniEvents
tcp 0 0 :::111 :::* 收听 1902/rpcbind

当有多个网络接口可用时,omniORB 任意选择其中一个用于发布对象引用(参见 http://omniorb.sourceforge.net/omni41/omniNames.html 中的第 5 部分)。在您的情况下,当您连接到网络时,它似乎正在获取 eth0,无论出于何种原因(可能是防火墙设置),它都不能很好地与 omniNames 配合使用。

为了解决这个问题,我建议将以下行添加到您的 /etc/omniORB.cfg 文件中:

endPoint = giop:tcp:127.0.0.1:

这将强制 omniNames 始终使用本地环回而不是 eth0。鉴于您当前的 omniORB.cfg 设置,我假设您的应用程序可以接受使用 localhost。如果不是这种情况(即,您确实需要使用 eth0 而不是 localhost),我们将需要找到 omniNames 在您的 eth0 接口上出现问题的根本原因。


澄清(因为我不能在评论部分使用换行符):

尝试将日志级别提高到 40,看看这些日志行之间是否显示了任何有用的内容:

omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
omniORB: Removing root<0> (etherealising) from object table

我无法重现您的问题。在我的工作案例中,我得到这样的结果:

omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:127.0.0.1:60625
omniORB: Adding root<0> (activating) to object table.

我想看看第二行的 IP 对你来说是否可疑。

我为此工作了一个星期……但最终找到了解决方案,因为 DrewC 为我指出了新的寻找方向。

在 etc/host 文件中,我添加了一行“127.0.0.1 ‘ComputerName’”,问题就消失了。

布拉德