Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我编写了一些应该作为服务器运行的代码,并用守护进程将其包装为Daemons.run('myserver.rb'). 当我运行它时./daemon.rb start它可以工作但它根本没有信息,即如果myserver.rb抛出异常我什至不知道我的服务器没有启动,守护进程将以退出代码 0 退出。有没有办法告诉守护进程返回一个非- 如果包装的脚本无法启动,则退出代码为零?或者也许是另一种让我知道我的服务器是否成功启动的方法?
Daemons.run('myserver.rb')
./daemon.rb start
myserver.rb
尝试
d=Daemons.run('myserver.rb') exit d.applications.length > 0 ? 0 : 1