Ubuntu 10.10 rc.local 忽略一半命令?
我在rc.local
中有一个自动启动的java程序(在ubuntu中是/etc/init.d/rc.local
) 由于某种原因,在 ubuntu 中自动启动时,执行 java 并记录其输出的命令只能工作一半,而它在命令行中按预期工作,并且也可以在任何 RHEL 发行版上工作(在 rc.local 和命令行中)。 我尝试执行的命令是:
java -server -cp '/foo/bar/' SomeServer > '/foo/bar/log.txt' &
在 ubuntu 中启动时,它只是启动服务器并将 log.txt 重写为空白日志,但不再记录服务器程序的输出...所有权限都绝对设置正确..不知道还要研究什么.. 任何帮助表示赞赏。谢谢。
I have a java program on autostart in rc.local
(in ubuntu its /etc/init.d/rc.local
)
For some reason in ubuntu on autostart the command to execute java and log its output only half works, while it works as expected in the command line and it also works on any RHEL distro (in rc.local and command line).
the command im trying to execute is:
java -server -cp '/foo/bar/' SomeServer &> '/foo/bar/log.txt' &
At boot in ubuntu it just starts the server and rewrites log.txt to a blank log, but doesnt log any more of the output of the server program... All the permissions are definitely set right.. not sure what else to look into..
Any help is appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以这是我的答案:)
Do:
rc.local
是由/bin/sh
执行的,而不是/bin/bash
这使得区别。So here's my answer then :)
Do:
rc.local
is executed by/bin/sh
not/bin/bash
and this makes the difference.