seuros / capistrano-puma

Puma integration for Capistrano
https://github.com/seuros/capistrano-puma
MIT License
615 stars 299 forks source link

Bump puma version to 5.x #298

Closed krim closed 3 years ago

krim commented 4 years ago

Fix https://github.com/seuros/capistrano-puma/issues/297 Upgrade guide: https://github.com/puma/puma/blob/master/5.0-Upgrade.md

seuros commented 4 years ago

This is not working. The deployment will never finish .

Did you try it ?

krim commented 4 years ago

@seuros, of course, I tried it. My puma.rb:

#!/usr/bin/env puma

directory '/home/back/current'
rackup "/home/back/current/config.ru"
environment 'production'

pidfile "/home/back/shared/tmp/pids/puma.pid"
state_path "/home/back/shared/tmp/pids/puma.state"
stdout_redirect '/home/back/current/log/puma.error.log', '/home/back/current/log/puma.access.log', true

threads 4,8
bind 'unix:///home/back/shared/tmp/sockets/puma.sock'

workers 0

preload_app!

before_fork do
  ActiveRecord::Base.connection_pool.disconnect!
end

on_worker_boot do
  ActiveSupport.on_load(:active_record) do
    ActiveRecord::Base.establish_connection
  end
end

I use systemd as recommended here: https://github.com/puma/puma/blob/master/5.0-Upgrade.md#upgrade So, I missed removing the--daemon flag. Now I tried to use start/restart/reload and everything works fine.

danarnold commented 4 years ago

@krim When configured without puma daemonization, does the puma.rb generated by capistrano-puma work still, or does it require a custom one? Are you using the standard systemd unit file as defined here, or a custom one? If a custom one is being used, can you share it and/or add documentation for it?

braindeaf commented 3 years ago

Just tried this on our staging server and the --daemon option was still there in the monit config. sadly it didn't boot at all even when I manually removed it.