Add command to list currently subscribed clients
I thought it would be useful to have a list of subscribed clients and get some status information about them. So I added a new supervisor cmd to log that information on request.
FYI: the output looks like this:
watchdogd[732]: Subscribed clients:
watchdogd[732]: process: 1, id: 1, pid: 733, label: watchdogd-client-example, timeout: 3000ms, time-left: 2483ms
And in case timerfd_gettime returns an error (e.g. when watchdogd is disabled):
watchdogd[732]: Subscribed clients:
watchdogd[732]: process: 1, id: 1, pid: 733, label: watchdogd-client-example, timeout: 3000ms, time-left: 0ms
It just returns 0ms instead of an invalid value.
Any chance that this gets merged?
Sorry for the late reply, I've been swamped with other duties, yet I have been thinking about this one long and hard in the background, unsure how to reply ...
... because I really don't want to discourage you, but I would like to get the client list displayed by watchdogctl, on stdout, and not sent to syslog. If a user wants to send it to syslog, they can pipe it to the logger command, or similar.
This means extra work on the IPC between the daemon and the client (I've done this in other projects of mine already, e.g., finit, mrouted, and a few others).
Thanks for your reply. Having it as stdout by watchdogctl would also be my preferred solution. However I wanted to make this change as minimal as possible. If you plan to do it as stdout, you can just decline it, fine for me.
That's just it, I have no current plans to work on watchdogd, so if you'd like to have a go at it I'm happy to review.
Thank you for this contribution! I've adopted it and added JSON output support as well.