1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/diaspora_ynh.git synced 2024-09-03 18:26:13 +02:00

Drop unicorn in favor of puma

This commit is contained in:
Salamandar 2024-07-01 10:20:45 +02:00
parent 0aef5f2408
commit 7e9bdfc41f
4 changed files with 13 additions and 12 deletions

View file

@ -1,5 +1,5 @@
[Unit]
Description=Diaspora social network (unicorn - instance __APP__)
Description=Diaspora social network (puma - instance __APP__)
PartOf=__APP__.target
[Service]
@ -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

View file

@ -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

View file

@ -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"

View file

@ -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