setup-grest: Improve cleanup of cron scripts and running jobs #1699
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently, setup-grest.sh relies on removing individual files and kill corresponding cron job processes. This can lead to multiple scenarios where old (retired) cron jobs may not be cleaned up, as well as relies on assumptions on nomen clature of running processes (which as seen in #1666 is not always true)
CRON_SCRIPTS_DIR
from /etc/cron.d, as well as empty theCRON_SCRIPTS_DIR
itselfpsql
session (it is a bit aggressive, but does not break any non-psql sessions like an admin client or dbsync - cron jobs always run as psql commands, the only other psql references on gRest nodes should be get-metrics script, which should anyways have a hiccup when removing all gRest functions), rather than having to maintain a list. This is only triggered when using-q
or-r
flags.Which issue it fixes?
Closes #1666
How has this been tested?
Tested in-place update on guildnet node