The current way of restarting a Rails app requires sudo privileges because we start with systemd. And we start with systemd because we want the site to be available automatically on start-up.
We could simply try to restart with the tmp/restart.txt approach. The net seems to say that works for Puma.
There is an interesting way you can start services on demand ("socket activation"), which covers the automatic start issue. Maybe that can be combined with a service that runs under a user's permission, to make it so restarting with systemctl can be done by the deploy user.
The current way of restarting a Rails app requires
sudoprivileges because we start withsystemd. And we start withsystemdbecause we want the site to be available automatically on start-up.We could simply try to restart with the
tmp/restart.txtapproach. The net seems to say that works for Puma.There is an interesting way you can start services on demand ("socket activation"), which covers the automatic start issue. Maybe that can be combined with a service that runs under a user's permission, to make it so restarting with
systemctlcan be done by the deploy user.