【问题标题】:Running unicorn as a service on centos to work with capistrano在 centos 上运行 unicorn 作为服务与 capistrano 一起工作
【发布时间】:2014-11-14 15:03:16
【问题描述】:

我正在尝试使用 capistrano 3 进行部署,在 centos 6.5 上使用 nginx-unicorn。我能够运行 cap production deploy,然后 ssh 进入服务器并手动重新启动它。

我尝试包含 gem - https://github.com/kalys/capistrano-nginx-unicorn - 以自动重启 unicorn 和 nginx,但在尝试将 unicorn 作为服务重启时失败,运行此命令

/usr/bin/env sudo service unicorn_app_name_production stop
*service does not exist*

我在unicorn手动运行时检查了服务,它不在那里,我一般用这个命令启动它

unicorn_rails -c config/unicorn.rb -E production -D

我使用本教程设置服务器 - https://www.digitalocean.com/community/tutorials/how-to-deploy-rails-apps-using-unicorn-and-nginx-on-centos-6-5

有什么帮助吗?

【问题讨论】:

    标签: ruby-on-rails nginx unicorn capistrano3 centos6.5


    【解决方案1】:

    您可以在类似的 gem 上查看this issue(capistrano-unicorn-nginx 基本上是 kalys/capistrano-nginx-unicorn 的改进分支)。 免责声明:我目前维护该宝石。

    核心问题是,这两个 gem 都经过测试可以在 Ubuntu(而不是 CentOS)上运行,因此它们使用的是 Ubuntu 特性(目录等)。

    我建议分叉您当前正在使用的 gem,并根据您的需要手动调整任务。 例如,您可能需要更改 this,以便任务使用在 centos 上工作的命令。

    如果您设法完成这项工作,我将非常感谢您在this issue 中留下反馈,因为这将帮助我最终为 Ubuntu、CentOS 和其他发行版制定解决方案。

    【讨论】:

      猜你喜欢
      • 2013-02-06
      • 1970-01-01
      • 2015-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-17
      • 2016-12-18
      相关资源
      最近更新 更多