From 28fb00a012a39155e7a115a2e77f9b69906a9c27 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Tue, 1 Oct 2024 19:50:43 +1000 Subject: [PATCH] Debugging shizzle --- src/dinitctl.cc | 3 +++ src/includes/dinit-client.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/dinitctl.cc b/src/dinitctl.cc index 56086141..1259bcfb 100644 --- a/src/dinitctl.cc +++ b/src/dinitctl.cc @@ -1012,14 +1012,17 @@ static int start_stop_service(int socknum, cpbuffer_t &rbuffer, const char *serv rbuffer.consume(1); // consume header if (reply_pkt_h == cp_rply::PREACK) { + std::cout << "*** got PREACK" << std::endl; // XXX // We should consider state changes seen only after the PREACK (i.e. between the // PREACK and the main reply): seen_states.started = false; seen_states.stopped = false; seen_states.failed_start = false; + std::cout << "*** waiting for reply after PREACK" << std::endl; // XXX // PREACK will be followed by a 2nd reply, get that now: wait_for_reply(rbuffer, socknum, handle, &seen_states); + std::cout << "*** got reply after PREACK" << std::endl; // XXX reply_pkt_h = (cp_rply)rbuffer[0]; rbuffer.consume(1); } diff --git a/src/includes/dinit-client.h b/src/includes/dinit-client.h index 8f2eac77..a2caa46f 100644 --- a/src/includes/dinit-client.h +++ b/src/includes/dinit-client.h @@ -1,6 +1,8 @@ #include #include +#include + #include #include @@ -239,12 +241,15 @@ inline void wait_for_reply(cpbuffer_t &rbuffer, int fd, dinit_cptypes::handle_t if (ev_handle == handle) { if (event == service_event_t::STOPPED) { + std::cout << "*** got SERVICEEVENT STOPPED" << std::endl; seen_states->stopped = true; } if (event == service_event_t::STARTED) { + std::cout << "*** got SERVICEEVENT STARTED" << std::endl; seen_states->started = true; } if (event == service_event_t::FAILEDSTART) { + std::cout << "*** got SERVICEEVENT FAILEDSTART" << std::endl; stopped_reason_t stop_reason = static_cast(rbuffer[base_pkt_size + 2]);