Skip to content
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

register DAEMON and EVENTS processes so cyr_info proc can list them #4522

Merged
merged 16 commits into from
Jun 28, 2023

Conversation

elliefm
Copy link
Contributor

@elliefm elliefm commented Jun 5, 2023

reviewers: This will be easiest to review commit-by-commit.

cyr_info proc lists all the running processes for cyrus.conf SERVICES entries. This PR extends this to also include processes for EVENTS and DAEMON entries. With this change, cyr_info proc lists all* running processes managed by master.

The existing SERVICES processes register themselves using the API functions provided by imap/proc.c. EVENT and DAEMON processes are expected to often be external scripts, so their registration is taken care of directly by master. This required relocating the proc.c API functions from libcyrus_imap to libcyrus_min (so that master can call them), and refactoring to make them re-entrant (because master needs to register its many children, not itself).

Some Cassandane internals needed a small refactor to make this testable, and I found and fixed a bug in our cunit test logging too.

Processes from the START section are not registered, and thus not listed by cyr_info proc. Since these are by definition short-lived processes that only run once during startup -- and if they fail, startup fails -- it didn't seem worth it. I could be persuaded otherwise.

@elliefm elliefm force-pushed the v39/proc-info-for-daemons branch 5 times, most recently from 0c77f97 to 979f751 Compare June 9, 2023 05:49
@elliefm elliefm force-pushed the v39/proc-info-for-daemons branch 2 times, most recently from 5dbe167 to bb04488 Compare June 21, 2023 00:53
@elliefm elliefm force-pushed the v39/proc-info-for-daemons branch 5 times, most recently from 9f99dfd to 9ccabd2 Compare June 23, 2023 03:53
and existing callers now check the return value and fatal themselves
The defining property of these objects is that they are listening
on a port, which conflicts with Cyrus's use of DAEMON for things
that are not listening on a port.
not strictly related to this PR, but I've been wanting to do this
for ages, and now I can, and it shows that the previous commit works
@elliefm elliefm changed the title V39/proc info for daemons register DAEMON and EVENTS processes so cyr_info proc can list them Jun 26, 2023
@elliefm elliefm marked this pull request as ready for review June 26, 2023 06:30
Copy link
Contributor

@ksmurchison ksmurchison left a comment

Choose a reason for hiding this comment

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

LGTM

@elliefm elliefm merged commit 80e1857 into cyrusimap:master Jun 28, 2023
1 check passed
@elliefm elliefm deleted the v39/proc-info-for-daemons branch June 28, 2023 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants