diff --git a/conf/diaspora_web.service b/conf/diaspora_web.service index e7fdd4b..9088676 100644 --- a/conf/diaspora_web.service +++ b/conf/diaspora_web.service @@ -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 diff --git a/scripts/install b/scripts/install index 40b51f5..b96995d 100755 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/restore b/scripts/restore index d7d5a99..e0b1fa2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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" diff --git a/scripts/upgrade b/scripts/upgrade index ac42dc2..f250f03 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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