Eric Guo's blog.cloud-mes.com

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Migrate Capistrano3-puma to Using SystemD Mode and Puma 5.0

Permalink

Source code change

Puma 5.0 removed eaemonization without replacement and finally capistrano3-puma start using systemd to manage the puma server and here is need to do to upgrade puma 4 to puma 5.

Capfile
require 'capistrano/puma'
install_plugin Capistrano::Puma
install_plugin Capistrano::Puma::Nginx
+install_plugin Capistrano::Puma::Systemd

Enable deployer user sudo.

sudo su -
cd /etc/sudoers.d/
echo 'deployer ALL=(ALL) NOPASSWD:ALL' > 80-deployer-user
visudo # refresh only

Enable systemd puma.service

sudo mv /etc/systemd/system/puma.service /etc/systemd/system/puma_prod.service
# $get home folder like /home/deployer
cd && pwd
# replace $home with /home/deployer
sudo vi /etc/systemd/system/puma_prod.service
sudo systemctl daemon-reload
sudo systemctl enable puma_prod

NLS_LANG setting for systemd

Modify systemd.conf at /etc/systemd/system.conf

system.conf
DefaultEnvironment="NLS_LANG='AMERICAN_AMERICA.AL32UTF8'"

Comments