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

statd,confd: misc. fixes with improved debug support #82

Merged
merged 2 commits into from
Aug 6, 2023
Merged

Conversation

troglobit
Copy link
Contributor

@troglobit troglobit commented Jul 5, 2023

Fix a problem with statd not properly mapping all kernel operstates to proper yang oper-status names. E.g., LOWERLAYERDOWN should map top lower-layer-down. <-- (Fixed in #92)

Also includes a A mix of minor fixes and cleanup to both statd and confd, mostly focused on DEBUG() macros.

@troglobit troglobit requested a review from wkz July 5, 2023 23:42
@troglobit troglobit added this to the Infix v23.07 milestone Jul 6, 2023
@troglobit troglobit requested a review from rical July 31, 2023 15:18
Copy link
Contributor

@rical rical left a comment

Choose a reason for hiding this comment

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

The small fixes all look fine.
However, I did another implementation of the operstate formatting. Have a look and see what you think of it #92

src/statd/statd.c Outdated Show resolved Hide resolved
@troglobit troglobit marked this pull request as draft August 2, 2023 09:12
@troglobit
Copy link
Contributor Author

With #92 having been merged, I've converted this PR into a draft to strip it down to the relevant parts not covered by #92.

The idea is to 1) map debug/error macros to syslog(), which does not
need \n, and 2) when stdout logging is used, let the macro add a \n.

Signed-off-by: Joachim Wiberg <[email protected]>
 - add debug flag to trigger DEBUG() statements
 - DEBUG() macro needs 'path' argument

For statd we can add support for an optional '-d' command line option to
trigger, and SIGUSR1 to toggle, debug mode.  TBD for confd which still
remains to be refactored into the same standalone daemon as statd.

Signed-off-by: Joachim Wiberg <[email protected]>
@troglobit troglobit changed the title statd: handle difference in kernel and yang oper-status names statd,confd: misc. fixes with improved debug support Aug 2, 2023
@troglobit troglobit requested a review from rical August 2, 2023 12:00
@troglobit troglobit marked this pull request as ready for review August 2, 2023 12:40
@wkz wkz merged commit 1afc2ad into main Aug 6, 2023
2 checks passed
@wkz wkz deleted the statd-fixes branch August 6, 2023 22:28
@troglobit troglobit modified the milestones: Infix v23.07, Infix v23.08 Aug 29, 2023
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.

3 participants