diff --git a/README.md b/README.md index 1096fe3..50adccd 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Description=Partynest web server [Service] ExecStart=/usr/bin/bundle exec rails server --environment production Group=group -Restart=on-failure +Restart=always RestartSec=1 StandardOutput=syslog StandardError=syslog diff --git a/config/deploy.rb b/config/deploy.rb index 152c0a9..a1d7ba3 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -53,5 +53,5 @@ append :linked_dirs, after 'deploy:publishing', 'deploy:restart' -after 'deploy:restart', 'puma:restart' +after 'deploy:restart', 'puma:stop' after 'deploy:restart', 'sidekiq:stop' diff --git a/lib/capistrano/tasks/puma.rake b/lib/capistrano/tasks/puma.rake index 7f4db25..2ecc52e 100644 --- a/lib/capistrano/tasks/puma.rake +++ b/lib/capistrano/tasks/puma.rake @@ -1,12 +1,12 @@ # frozen_string_literal: true namespace :puma do - desc 'Restart Puma web server' - task :restart do + desc 'Stop Puma web server' + task :stop do on roles(:web) do within release_path do statefile = File.join shared_path, 'tmp', 'pids', 'puma.state' - execute :bundle, :exec, :pumactl, '--state', statefile, :restart + execute :bundle, :exec, :pumactl, '--state', statefile, :stop end end end