-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
add eventrequest message (wip) #256
add eventrequest message (wip) #256
Conversation
Also there is currently a problem when monitoring more than one service. dinit-monitor does only recieve initial service events for one of them. (the last one in the list I think). This seems to be related to dinit(control.cc) only responding to the first EVENTREQUEST message it gets? I'm not sure why this is, as I'm not familiar with the dasynq callback stuff. I've monitored the socket control traffic with the help of socat. And there is definetly only one response despite there being two requests. The requests seem to be in one message tho, this might be a problem?
Then calling dinit-monitor with --request:
results in only one initial status. Any ideas how to fix this? |
I think that the existing ways of getting a service status should really be enough:
It really feels to me like it shouldn't be necessary to prompt dinit to re-send status, given that clients are supposed to be able to keep track of the status themselves. If I understand correctly, what you want is to have get Edit: to be clear, you just need to keep the service state that is returned from the
It looks like there may actually be a bug in the command processing logic so that it doesn't currently process more than one command if multiple commands happen to get buffered together. I'll fix that soon. It's only come up in this case because the usual protocol is for the client to wait for a reply (i.e. command acknowledgement) after issuing each command, which wasn't happening with your implementation, so I don't think it affects any existing |
Sure, got your points. Also implementing it that way makes way more sense and is also simpler. Should note code while sleepy. But I'm glad this excursion may have catched a bug. made a new pr > #257 |
So I had the problem, that when i tried using dinit-monitor to execute some command on service state change, there was no way of executing a command for the initial state of the service when dinit-monitor is started. This resulted in me scripting around it with first calling dinitctl for the initial status and then dinit-monitor to recieve any further changes. Pretty unsatisfying solution.
So I ceated the EVENTREQUEST request type. It should result in dinit outputting the current state of the service as event if requested.
I also added the --request flag to dinit-monitor to make it request the initial status of the monitored services upon startup.
Works fine for my usecase, but I'm not sure if/how this fits into the overall design. What are your thoughts about this @davmac314 ?