diff --git a/config/deploy.rb b/config/deploy.rb index 3b1ab6d2c..b8906cd2a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -56,6 +56,7 @@ set :puma_service_unit_name, -> { "puma_#{fetch(:application)}_#{fetch(:stage)}" set :puma_bind, "unix://#{shared_path}/tmp/sockets/puma.sock" set :puma_access_log, -> { File.join(shared_path, "log", "puma_access.log") } set :puma_error_log, -> { File.join(shared_path, "log", "puma_error.log") } +set :puma_systemd_watchdog_sec, 0 set :delayed_job_workers, 2 set :delayed_job_roles, :background diff --git a/lib/capistrano/templates/puma.service.erb b/lib/capistrano/templates/puma.service.erb deleted file mode 100644 index 9571a15ad..000000000 --- a/lib/capistrano/templates/puma.service.erb +++ /dev/null @@ -1,40 +0,0 @@ -# This file tells systemd how to run Puma as a 24/7 long-running daemon. -# -# Customize this file based on your bundler location, app directory, etc. -# Customize and copy this into /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu). -# Then run: -# - systemctl enable <%= fetch(:puma_service_unit_name) %> -# - systemctl {start,stop,restart} <%= fetch(:puma_service_unit_name) %> -# -# -# Use `journalctl -u <%= fetch(:puma_service_unit_name) %> -rn 100` to view the last 100 lines of log output. -# -[Unit] -Description=Puma HTTP Server for <%= "#{fetch(:application)} (#{fetch(:stage)})" %> -<%= "Requires=#{fetch(:puma_service_unit_name)}.socket" if fetch(:puma_enable_socket_service) %> -After=network.target - -[Service] -Type=<%= service_unit_type %> -WatchdogSec=0 -<%="User=#{puma_user(@role)}" if fetch(:puma_systemctl_user) == :system %> -WorkingDirectory=<%= current_path %> -ExecStart=<%= expanded_bundle_command %> exec puma -e <%= fetch(:puma_env) %> -ExecReload=/bin/kill -USR1 $MAINPID -<%- Array(fetch(:puma_service_unit_env_files)).each do |file| %> -<%="EnvironmentFile=#{file}" -%> -<% end -%> -<% Array(fetch(:puma_service_unit_env_vars)).each do |environment_variable| %> -<%="Environment=\"#{environment_variable}\"" -%> -<% end -%> - -# if we crash, restart -RestartSec=1 -Restart=on-failure - -<%="StandardOutput=append:#{fetch(:puma_access_log)}" if fetch(:puma_access_log) %> -<%="StandardError=append:#{fetch(:puma_error_log)}" if fetch(:puma_error_log) %> - -SyslogIdentifier=puma -[Install] -WantedBy=<%=(fetch(:puma_systemctl_user) == :system) ? "multi-user.target" : "default.target"%>