Skip to content

Commit

Permalink
Drop unicorn in favor of puma
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamandar committed Jul 1, 2024
1 parent 0aef5f2 commit 7e9bdfc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions conf/diaspora_web.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Diaspora social network (unicorn - instance __APP__)
Description=Diaspora social network (puma - instance __APP__)
PartOf=__APP__.target

[Service]
Expand All @@ -10,8 +10,9 @@ Environment="__LD_PRELOAD__"
Environment="RAILS_ENV=production"
Environment="__YNH_RUBY_LOAD_PATH__"
PIDFile=/run/__APP__/diaspora.pid
ExecStart=__INSTALL_DIR__/live/bin/bundle exec unicorn -c config/unicorn.rb -E production
ExecReload=/bin/kill -USR2 $MAINPID
ExecStart=__INSTALL_DIR__/live/bin/bundle exec puma -C config/puma.rb
ExecReload=__INSTALL_DIR__/live/bin/pumactl -F config/puma.rb restart
ExecStop=__INSTALL_DIR__/live/bin/pumactl -F config/puma.rb stop
Restart=always

# Sandboxing options to harden security
Expand Down
6 changes: 3 additions & 3 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ ynh_add_systemd_config --service="${app}_web" --template="diaspora_web.service"

# Create target unit
_ynh_add_systemd_target
yunohost service add "$app.target" --description "Diaspora service (unicorn web and sidekiq)" \
yunohost service add "$app.target" --description "Diaspora service (web and sidekiq)" \
--log "$install_dir/live/log/production.log" \
"$install_dir/live/log/unicorn-stderr.log" \
"$install_dir/live/log/unicorn-stdout.log" \
"$install_dir/live/log/web-stderr.log" \
"$install_dir/live/log/web-stdout.log" \
"$install_dir/live/log/sidekiq.log"

# Create tmpfile
Expand Down
6 changes: 3 additions & 3 deletions scripts/restore
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ ynh_restore_file --origin_path="/etc/systemd/system/${app}_web.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}_sidekiq.service"
ynh_restore_file --origin_path="/etc/systemd/system/${app}.target"
systemctl enable "${app}_web" "${app}_sidekiq" "$app.target" --quiet
yunohost service add "$app.target" --description "Diaspora service (unicorn web and sidekiq)" \
yunohost service add "$app.target" --description "Diaspora service (web and sidekiq)" \
--log "$install_dir/live/log/production.log" \
"$install_dir/live/log/unicorn-stderr.log" \
"$install_dir/live/log/unicorn-stdout.log" \
"$install_dir/live/log/web-stderr.log" \
"$install_dir/live/log/web-stdout.log" \
"$install_dir/live/log/sidekiq.log"

ynh_restore_file --origin_path="/etc/tmpfiles.d/${app}.conf"
Expand Down
6 changes: 3 additions & 3 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ ynh_add_systemd_config --service="${app}_sidekiq" --template="diaspora_sidekiq.s
ynh_add_systemd_config --service="${app}_web" --template="diaspora_web.service"
# Create target unit
_ynh_add_systemd_target
yunohost service add "$app.target" --description "Diaspora service (unicorn web and sidekiq)" \
yunohost service add "$app.target" --description "Diaspora service (web and sidekiq)" \
--log "$install_dir/live/log/production.log" \
"$install_dir/live/log/unicorn-stderr.log" \
"$install_dir/live/log/unicorn-stdout.log" \
"$install_dir/live/log/web-stderr.log" \
"$install_dir/live/log/web-stdout.log" \
"$install_dir/live/log/sidekiq.log"

# Create tmpfile
Expand Down

0 comments on commit 7e9bdfc

Please sign in to comment.