-
Notifications
You must be signed in to change notification settings - Fork 4
A basic janitor service to handle recurring tasks - part 1 #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A basic janitor service to handle recurring tasks - part 1 #322
Conversation
b598fc9 to
b41ed8c
Compare
3e41412 to
e5d721d
Compare
ee9cace to
ac3367a
Compare
b5efa49 to
b50a697
Compare
| check_enabled "janitor" || return | ||
| DAEMON_PATH=${MIG_JANITOR} | ||
| SHORT_NAME=$(basename ${DAEMON_PATH}) | ||
| PID_FILE="$PID_DIR/${SHORT_NAME}.pid" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
b50a697 to
376a682
Compare
…next` branch for further development.
…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.
…d make the daemon itself very shallow.
`black $TARGET` and `isort --line-length=80 -m=HANGING_INDENT $TARGET` to each file in the new sbin/ and mig/lib/ dirs for cleanliness.
functionality to ease support load.
…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.
e51f9e3 to
34b75d8
Compare
A standalone
grid_janitorservice 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
nextbranch for further development.