Skip to content

Conversation

@jonasbardino
Copy link
Contributor

@jonasbardino jonasbardino commented Sep 1, 2025

A standalone grid_janitor service as outlined in the linked milestone to eventually handle a range of recurring tasks better done in a long-running background process. The core service is implemented and functional and this first iteration mainly handles pruning of account requests. State clean up and cache updates are pending in follow-up parts. Input and comments are of course welcome.

This work was originally started as PR #215 but since ported to next branch for further development.

@jonasbardino jonasbardino self-assigned this Sep 1, 2025
@jonasbardino jonasbardino added the enhancement New feature or request label Sep 1, 2025
@jonasbardino jonasbardino linked an issue Sep 1, 2025 that may be closed by this pull request
@jonasbardino jonasbardino force-pushed the add/basic-vgrid-janitor-service-for-recurring-tasks-like-clean-up_next branch from b598fc9 to b41ed8c Compare September 1, 2025 17:50
@jonasbardino jonasbardino marked this pull request as ready for review September 1, 2025 17:58
@jonasbardino jonasbardino force-pushed the add/basic-vgrid-janitor-service-for-recurring-tasks-like-clean-up_next branch 2 times, most recently from 3e41412 to e5d721d Compare September 4, 2025 05:07
@jonasbardino jonasbardino force-pushed the add/basic-vgrid-janitor-service-for-recurring-tasks-like-clean-up_next branch from ee9cace to ac3367a Compare September 24, 2025 15:22
@jonasbardino jonasbardino force-pushed the add/basic-vgrid-janitor-service-for-recurring-tasks-like-clean-up_next branch 2 times, most recently from b5efa49 to b50a697 Compare September 25, 2025 13:29
@jonasbardino jonasbardino changed the title A basic janitor service to handle recurring tasks like clean up and cache updates A basic janitor service to handle recurring tasks like account request pruning, clean up and cache updates Sep 25, 2025
@jonasbardino jonasbardino changed the title A basic janitor service to handle recurring tasks like account request pruning, clean up and cache updates A basic janitor service to handle recurring - tasks part 1 Sep 25, 2025
@jonasbardino jonasbardino changed the title A basic janitor service to handle recurring - tasks part 1 A basic janitor service to handle recurring tasks - part 1 Sep 25, 2025
check_enabled "janitor" || return
DAEMON_PATH=${MIG_JANITOR}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PID_FILE doesn't appear to be used here?

Copy link
Contributor Author

@jonasbardino jonasbardino Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that looks true.
It's a simple copy/paste of what we do for all the other migrid service daemons, and AFAICT the PID_FILE is only directly used in the corresponding deb (Debian/Ubuntu) template. It should perhaps be used on rh (RHEL/Rocky), too, but that would be something to handle and test thoroughly in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a TODO about it in the template.

@jonasbardino jonasbardino force-pushed the add/basic-vgrid-janitor-service-for-recurring-tasks-like-clean-up_next branch from b50a697 to 376a682 Compare September 26, 2025 07:06
…it. The

previous commit only had the polished skeleton in place.
…g on reset

token validity. Prepared for automatic handling of other trivial requests like
renewal with valid peer or rejection of obviously invalid requests.
Minor adjustment to skip subdirs when cleaning files in state dirs.
…jection

of expired account requests. Elaborate on reject reasons. Extend infrastructure
to allow rejection of obviously invalid requests based e,g, on detection during
submit. In that way we can check e.g. valid password for expired accounts
during submit but delay actual rejection until janitor picks it up with
sufficient delay to avoid introducing a trivial password cracking mechanism in
the account request forms. We can similarly test early if a requested peer has
an account and reject in janitor if not.
 - requests for renew with existing user ID collisions
 - requests for renew with unauthorized password change
 - requests for renew of suspended/blocked accounts
 - requests with insufficient peers info
 - requests with expire set in the past
 - requests with invalid full name

Polished some style bits and stripped some undesired newlines in log entries.
`black $TARGET`
and
`isort --line-length=80 -m=HANGING_INDENT $TARGET`
to each file in the new sbin/ and mig/lib/ dirs for cleanliness.
…tuple init

of the `title_entry['container_class']`.
…e case of

triggering next run in otherwise idle daemons.
…e recently

added daemon helpers for the purpose. Should also make the daemon a lot more
responsive to the normal SIGINT shutdown signal.
…logically

True function object itself. Thanks @rasmunk for catching and reporting that
important little detail.
@jonasbardino jonasbardino force-pushed the add/basic-vgrid-janitor-service-for-recurring-tasks-like-clean-up_next branch from e51f9e3 to 34b75d8 Compare September 26, 2025 09:23
@jonasbardino jonasbardino merged commit 6fda6bc into next Sep 26, 2025
10 checks passed
@jonasbardino jonasbardino deleted the add/basic-vgrid-janitor-service-for-recurring-tasks-like-clean-up_next branch September 26, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants