我目前正在登台(Ubuntu)上运行工头,一旦我开始工作,将切换到使用新贵。
我的 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 不启动呢?