最好建议您将代码配置为作为服务运行。有几种包装器,例如:
- http://wrapper.tanukisoftware.com/doc/english/app-hello-world-server.html
完成此操作后,您可以配置Chef以管理新服务:
service "myapp_service" do supports :status => true, :restart => true start_command "/usr/lib/myapp/bin/myapp start" restart_command "/usr/lib/myapp/bin/myapp restart" status_command "/usr/lib/myapp/bin/myapp status" action [ :enable, :start ]end



