问题与xinetd参数

我创build了这个BASH脚本叫blah,它做了一些简单的事情(见下文)

#./blah -x "bindas" hello bindas 

我想用dynamicvariables执行xinetd脚本,类似于下面的例子

 #telnet localhost 809 "bindas" hello bindas. 

我不打算用telnet,实际上其他一些应用程序将尝试与809端口上的此服务器进行通信。 我如何安排我的xinetd文件参数? 我发现server_args可以采取参数,但如何这样的事情,这将工作?

 # This file is being maintained by Puppet. # DO NOT EDIT service cont_blah { port = 809 disable = no socket_type = stream protocol = tcp wait = no user = root group = root groups = yes server = /usr/local/bin/blah server_args = -x $1 } 

没有,这将无法正常工作。

通过TCP套接字接收到的input不被xinetd解释,所以不能作为命令行parameter passing给脚本。 您的脚本将需要读取任何数据接收作为标准input,例如

 #!/bin/bash read name echo "Hello $name"