From: Frantisek Sumsal Date: Wed, 8 Nov 2023 22:57:27 +0000 (+0100) Subject: busctl: send READY=1 when we become a monitor X-Git-Tag: v255-rc2~68^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c39a6ab7898efb2c825ab15c3b168f8412c9b704;p=thirdparty%2Fsystemd.git busctl: send READY=1 when we become a monitor This is pretty much the same stuff as `resolvectl monitor` does, and allows us to run `busctl monitor` in a Type=notify unit which ensures that `busctl` is really listening for messages once the unit is marked as started. --- diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index d13d5bef6d9..9f82198f2f1 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -1311,6 +1311,8 @@ static int monitor(int argc, char **argv, int (*dump)(sd_bus_message *m, FILE *f if (!arg_quiet && arg_json_format_flags == JSON_FORMAT_OFF) log_info("Monitoring bus message stream."); + (void) sd_notify(/* unset_environment=false */ false, "READY=1"); + for (;;) { _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;