ruby-on-rails – Foreman无法启动Nginx,但我可以手动启动它.为什么?

weixin_38051859 2019-09-12 01:15:24
我目前在登台(Ubuntu)上运行Foreman,一旦我开始工作将切换到使用upstart. 我的Procfile.staging看起来像这样: nginx: sudo service nginx start unicorn: bundle exec unicorn -c ./config/unicorn.rb redis: bundle exec redis-server sidekiq: bundle exec sidekiq -v -C ./config/sidekiq.yml 我可以使用以下命令成功启动nginx: $sudo service nginx start 但是,当我运行$foreman start,而其他三个进程成功启动时,nginx不会: 11:15:46 nginx.1 | started with pid 15966 11:15:46 unicorn.1 | started with pid 15968 11:15:46 redis.1 | started with pid 15971 11:15:46 sidekiq.1 | started with pid 15974 11:15:46 nginx.1 | Starting nginx: nginx. 11:15:46 nginx.1 | exited with code 0 11:15:46 system | sending SIGTERM to all processes SIGTERM received 11:15:46 unicorn.1 | terminated by SIGTERM 11:15:46 redis.1 | terminated by SIGTERM 11:15:46 sidekiq.1 | terminated by SIGTERM 那么为什么在Foreman开始时nginx不会出现呢?
...全文
25 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38053353 2019-09-12
  • 打赏
  • 举报
回复
这是您的Procfile中的问题. nginx命令不能在foreman中使用sudo,因为它总是要求输入密码然后它将失败.这就是你没有启动nginx并且日志为空的原因. 如果你真的需要在procfile中使用sudo,你可以使用这样的东西: sudo_app: echo "sudo_password" | sudo -S app_command nginx: echo "sudo_password" | sudo -S service nginx start 我真的不推荐.其他选择是打电话给sudo工头开始 有关更多信息,请查看此issue on github,这正是您想要解决的问题. 如果它适合你,请让我发布.

476

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧