diff --git a/src/daemon/rpmostreed-daemon.c b/src/daemon/rpmostreed-daemon.c index bedb7728..01752c3b 100644 --- a/src/daemon/rpmostreed-daemon.c +++ b/src/daemon/rpmostreed-daemon.c @@ -180,8 +180,10 @@ on_active_txn_changed (GObject *object, g_variant_get (active_txn, "(&s&s&s)", &method, &sender, &path); if (*method) { + gboolean is_registered = rpmostreed_daemon_has_client (self, sender); + const char *caller_str = is_registered ? "client" : "caller"; sd_journal_send ("MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(RPMOSTREE_MESSAGE_TRANSACTION_STARTED), - "MESSAGE=Initiated txn %s for caller %s: %s", method, sender, path, + "MESSAGE=Initiated txn %s for %s %s: %s", method, caller_str, sender, path, NULL); } } @@ -371,6 +373,13 @@ rpmostreed_daemon_add_client (RpmostreedDaemon *self, render_systemd_status (self); } +/* Return `TRUE` if the bus address @client called RegisterClient. */ +gboolean +rpmostreed_daemon_has_client (RpmostreedDaemon *self, const char *client) +{ + return g_hash_table_contains (self->bus_clients, client); +} + void rpmostreed_daemon_remove_client (RpmostreedDaemon *self, const char *client) diff --git a/src/daemon/rpmostreed-daemon.h b/src/daemon/rpmostreed-daemon.h index f1126d6a..798fd33e 100644 --- a/src/daemon/rpmostreed-daemon.h +++ b/src/daemon/rpmostreed-daemon.h @@ -31,6 +31,7 @@ GType rpmostreed_daemon_get_type (void) G_GNUC_CONST; RpmostreedDaemon * rpmostreed_daemon_get (void); void rpmostreed_daemon_add_client (RpmostreedDaemon *self, const char *client); void rpmostreed_daemon_remove_client (RpmostreedDaemon *self, const char *client); +gboolean rpmostreed_daemon_has_client (RpmostreedDaemon *self, const char *client); void rpmostreed_daemon_exit_now (RpmostreedDaemon *self); void rpmostreed_daemon_run_until_idle_exit (RpmostreedDaemon *self); void rpmostreed_daemon_publish (RpmostreedDaemon *self,