简体   繁体   English

如何使用厨师食谱运行红宝石服务

[英]How can i run my ruby service with chef recipe

I have a web service in ruby, and i want to run my ruby service via chef recipe. 我有一个红宝石Web服务,我想通过厨师食谱运行我的红宝石服务。 I have used execute command as : 我已经使用execute命令为:

execute 'start-ruby' do
command 'ruby /opt/certificate.rb start'
action :run
end

I can see my ruby service running in background on my Amazon instance, but somehow Instance setup is stuck in running setup. 我可以在我的Amazon实例上看到我的ruby服务在后台运行,但是由于某种原因,实例设置卡在了运行设置中。 Is there any other alternative from which i can run my ruby service via chef recipe. 我还有其他选择可以通过厨师食谱运行红宝石服务吗?

The execute resource runs its command synchronously, meaning it waits for it to finish before continuing with the recipe. execute资源同步运行其命令,这意味着它在继续执行配方之前要等待其完成。 I'm guessing your start command there starts a foreground-mode daemon (which is how it should work) so it never returns and Chef just waits forever. 我猜你的start命令在那里启动了前台模式守护程序(这是它应该如何工作的),所以它永远不会返回,Chef永远等待着。

Check out https://github.com/poise/application_examples/blob/master/recipes/todo_rails.rb or https://github.com/poise/poise-service for examples of Ruby application deployment and generic service management respectively. 分别查看https://github.com/poise/application_examples/blob/master/recipes/todo_rails.rbhttps://github.com/poise/poise-service ,以获取Ruby应用程序部署和常规服务管理的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM