Restarting Unicorn with USR2 doesn't seem to reload production.rb settings

前端 未结 2 1036
Happy的楠姐
Happy的楠姐 2021-02-01 17:58

I\'m running unicorn and am trying to get zero downtime restarts working.

So far it is all awesome sauce, the master process forks and starts 4 new workers, then kills t

2条回答
  •  逝去的感伤
    2021-02-01 18:39

    My guess is that your unicorns are being restarted in the old production directory rather than the new production directory -- in other words, if your working directory in unicorn.rb is /current, you need to make sure the symlink happens before you attempt to restart the unicorns.

    This would explain why stopping and starting them manually works: you're doing that post-deploy, presumably, which causes them to start in the correct directory.

    When in your deploy process are you restarting the unicorns? You should make sure the USR2 signal is being sent after the new release directory is symlinked as current.

    If this doesn't help, please gist your unicorn.rb and deploy.rb; it'll make it a lot easier to debug this problem.

提交回复
热议问题