Detect plugin installation and trigger Puma restart
This is a follow up of https://community.theforeman.org/t/when-should-the-installer-restart-puma/26162
To recap the issue: when you install or update a plugin today, puma needs to be restarted to load the new code, but this only happens if the installer detects this situation.
The detection, today, only detects two cases: a plugin was installed by the installer or the plugin got updated via packaging and has a new migration available.
A lot of .z plugin updates don't carry new migrations, and thus go undetected and break things (like views that try to load files that are gone and similar)
In the above discussion, we came to the conclusion we should try to detect these cases better and trigger a puma restart.
There are different proposals, but all have one in common: a package installation/upgrade somewhow marks the system as "dirty" ("changed") and this can be used as a flag for the restart.
There is an interesting feature in systemd (https://fedoraproject.org/wiki/Changes/Restart_services_at_end_of_rpm_transaction) that could be used for that, but it only would work on EL9 and other "modern" installs, while we also need to support "legacy" systems like EL8.
So the probably best next thing would be to have packaging touch a file somewhere (rails tmp?) and the installer ensuring this file as absent with a notification towards the service definition, thus triggering a restart.
The file in rails tmp also could be used as a source for UI notifications about a needed restart.
#5 Updated by Evgeni Golov about 2 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset puppet-foreman|10bcb5cc1b783381b0a58771eecd264c5d38f5fc.