Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup-grest: Improve cleanup of cron scripts and running jobs (#1699)
## Description <!--- Describe your changes --> 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) - [x] Remove all cron jobs for given `CRON_SCRIPTS_DIR` from /etc/cron.d, as well as empty the `CRON_SCRIPTS_DIR` itself - [x] Use PG_CANCEL_BACKEND and PG_TERMINATE_BACKEND psql calls to terminate all jobs run using installer user as `psql` 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? <!--- Link to issue: Closes #issue-number --> Closes #1666 ## How has this been tested? <!--- Describe how you tested changes --> Tested in-place update on guildnet node
- Loading branch information