Unified Backup: Update gitlab-backup-cli to have custom process title
What does this MR do and why?
When running gitlab-backup-cli
, it does show up in ps
, top
and equivalent as ruby ./bin/gitlab-backup-cli some arguments here
. We can customize what is displayed there by relying on Process.setproctitle
: https://docs.ruby-lang.org/en//3.2/Process.html#method-c-setproctitle.
This allows for providing custom status of running operation.
This MR renames the process title to gitlab-backup-cli
upon start, and uses the following template to provide custom status that can be used at any point in the execution: gitlab-backup-cli: whatever you want to write here
.
It currently implements the custom status for when a backup is being performed or a restore.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Run:
./bin/gitlab-backup-cli backup all
in one terminal - While above is running, type
ps c | grep gitlab-backup-cli
in another terminal - Expect some output similar to :
57175 s008 R+ 0:02.50 gitlab-backup-cli: backup all
- Optionally compare the above with a branch on
master
- Run
./bin/gitlab-backup-cli restore BACKUP_ID_FROM_PREVIOUS_RUN
in one terminal - While above is runnig type
ps c | grep gitlab-backup-cli
in another terminal - Expect some output similar to :
57175 s008 R+ 0:02.50 gitlab-backup-cli: restore all from BACKUP_ID_FROM_PREVIOUS_RUN