通过xinetd的XML-RPC服务器 [英] XML-RPC server via xinetd

查看:91
本文介绍了通过xinetd的XML-RPC服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在试图弄清楚如何实现xinetd i.s.o调用
的XML-RPC服务器。监听TCP套接字本身。


我已经使用

SimpleXMLRPCServer实现了一个独立的XML-RPC服务器,但我现在想要类似的东西,是通过xinetd启动的
(即通过stdin / stdout读取/写入)。


任何提示或代码示例?


谢谢,


-

- Jos Vos< jo*@xos.nl>

- Open Systems BV的X / OS专家|电话:+31 20 6938364

- 荷兰阿姆斯特丹|传真:+31 20 6948204

Hi,

I''m trying to figure out how to implement a XML-RPC server that
is called by xinetd i.s.o. listening on a TCP socket itself.

I already have implemented a stand-alone XML-RPC server using
SimpleXMLRPCServer, but I now want something similar, that is
started via xinetd (i.e. reading/writing via stdin/stdout).

Any hints or code examples?

Thanks,

--
-- Jos Vos <jo*@xos.nl>
-- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
-- Amsterdam, The Netherlands | Fax: +31 20 6948204

推荐答案

Jos Vos写道:
Jos Vos wrote:


我我试图弄清楚如何实现xinetd iso调用的XML-RPC服务器听取TCP套接字本身。

我已经使用SimpleXMLRPCServer实现了一个独立的XML-RPC服务器,但我现在想要类似的东西,即通过xinetd启动(即通过stdin / stdout读/写)。

任何提示或代码示例?

谢谢,
Hi,

I''m trying to figure out how to implement a XML-RPC server that
is called by xinetd i.s.o. listening on a TCP socket itself.

I already have implemented a stand-alone XML-RPC server using
SimpleXMLRPCServer, but I now want something similar, that is
started via xinetd (i.e. reading/writing via stdin/stdout).

Any hints or code examples?

Thanks,




这不仅仅是一个标准的守护进程功能吗?

所以如果你能把你的程序包装成像时尚这样的守护进程(例如
http://homepage.hispeed.ch/py430/python/daemon.py )然后指向

xinetd配置到正确的脚本,它应该工作吗?


请注意我自己还没有尝试过这个;-)虽然应该在

不久的将来如果你可以对你的进展进行一次了解我会赞赏它。


-

mph



Isn''t this just a standard daemon functionality?
So if you could wrap up your program in a daemon like fashion (e.g.
http://homepage.hispeed.ch/py430/python/daemon.py) and then point the
xinetd configuration to the right script, it should just work?

Beware that I didn''t try this myself yet ;-) though should do in the
near future so if you could give a head ups on your progress I would
appreciate it.

--
mph


On Sun,Apr 16,2006在下午10:13:19 +0200,Martin P. Hellwig写道:
On Sun, Apr 16, 2006 at 10:13:19PM +0200, Martin P. Hellwig wrote:
这不仅仅是标准的守护进程功能吗?


什么是标准守护进程? :-)

所以如果你能把你的程序包装成像时尚这样的守护进程(例如
http://homepage.hispeed.ch/py430/python/daemon.py )然后将
xinetd配置指向正确的脚本,它应该工作吗?
Isn''t this just a standard daemon functionality?
What is "a standard daemon"? :-)
So if you could wrap up your program in a daemon like fashion (e.g.
http://homepage.hispeed.ch/py430/python/daemon.py) and then point the
xinetd configuration to the right script, it should just work?




事实上,标准使用*是一个守护进程(即接受连接

)我希望它不是*守护进程。对于守护进程

方法我使用类似于daemonize的东西,但是现在我想要它来支持
*而不是*绑定等等来侦听端口。


问题是服务器初始化*需要*服务器

地址(主机,端口对),但我看不出怎么告诉它使用

stdin套接字(我担心这是不可能的,但我不是

肯定)。

-

- Jos Vos< jo*@xos.nl>

- Open Systems BV的X / OS专家电话:+31 20 6938364

- 荷兰阿姆斯特丹|传真:+31 20 6948204



In fact, the standard use *is* a daemon (that is, accepting connections
on a certain port) and I want it to be *not* a daemon. For the daemon
method I use something similar to "daemonize", but now I want it to
*not* do the binds etc. to listen on a port.

The problem is that the server initialization *requires* a server
address (host, port pair), but I don''t see how to tell it to use
the stdin socket (and I''m afraid this is not possible, but I''m not
sure).

--
-- Jos Vos <jo*@xos.nl>
-- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
-- Amsterdam, The Netherlands | Fax: +31 20 6948204


Jos Vos写道:

< cut>
Jos Vos wrote:
<cut>

问题是服务器初始化*需要*服务器地址(主机,端口对),但我不知道如何告诉它使用stdin套接字(我很害怕)这是不可能的,但我不确定。)

The problem is that the server initialization *requires* a server
address (host, port pair), but I don''t see how to tell it to use
the stdin socket (and I''m afraid this is not possible, but I''m not
sure).




如果我理解正确你想要python服务器绑定

取决于xinetd.conf中配置的内容而不是在你的程序本身的

中定义?


我用我的测试了一下FreeBSD机器,但确实是操作系统

环境给了我一些有趣的回复,留下那个选项

但是我可以指定命令行参数,这样你就可以把它们拿起来了.br / >
with sys.argv。


我查找了如何在xinetd中指定参数并根据

我过滤掉的各种资源(必须过了ese gnu type

documentation ...)你可以使用server_args在每个服务中

配置来指定参数。


虽然不是很优雅但是可以做一个动态端口绑定。


现在我只希望我理解你的问题:-)


-

mph



If I understood it correctly you want the python server bind be
depending on whatever is configured in xinetd.conf and not be defined in
the your program itself?

I tested a bit around with my FreeBSD machine but indeed the OS
environment gives me nothing interesting back, leaving that option out
but I do can specify command line arguments so you could pick them up
with sys.argv.

I looked up how you can specify arguments in xinetd and according to
various resources I filtered out (gotta over these gnu type
documentation...) that you can use "server_args" in the per service
configuration to specify arguments.

Although not really elegant it is doable to do an on the fly port binding.

Now I just hope I understood your problem :-)

--
mph


这篇关于通过xinetd的XML-RPC服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆