Add IgnoreOnIsolate=yes to dbus.service 57/315357/1 accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_x tizen accepted/tizen/unified/20240819.150119 accepted/tizen/unified/dev/20240821.053517 accepted/tizen/unified/x/20240820.013135
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 30 Jul 2024 15:34:57 +0000 (17:34 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 30 Jul 2024 15:34:57 +0000 (17:34 +0200)
During the Online OS Upgrade the

    systemctl isolate default.target

is performed, which caused the dbus.service to be shutdown.
After that sdbd does not work properly.

Change-Id: I7fb797c1ad316dabfab29256de7cf638eb329d0a
Signed-off-by: Mateusz Moscicki <m.moscicki2@partner.samsung.com>
bus/connection.c
bus/dbus.service.in
dbus/dbus-connection-internal.h
dbus/dbus-connection.c

index 15aea6e..dc5c7ed 100644 (file)
@@ -2458,6 +2458,21 @@ bus_transaction_send_from_driver (BusTransaction *transaction,
   if (!dbus_message_set_sender (message, DBUS_SERVICE_DBUS))
     return FALSE;
 
+  /* Make sure the message has a non-zero serial number, otherwise
+   * bus_transaction_capture_error_reply() will not be able to mock up
+   * a corresponding reply for it. Normally this would be delayed until
+   * the first time we actually send the message out from a
+   * connection, when the transaction is committed, but that's too late
+   * in this case.
+   */
+  if (dbus_message_get_serial (message) == 0)
+    {
+      dbus_uint32_t next_serial;
+
+      next_serial = _dbus_connection_get_next_client_serial (connection);
+      dbus_message_set_serial (message, next_serial);
+    }
+
   if (bus_connection_is_active (connection))
     {
       if (!dbus_message_set_destination (message,
index f03a743..50b45c0 100644 (file)
@@ -2,6 +2,7 @@
 Description=D-Bus System Message Bus
 Documentation=man:dbus-daemon(1)
 DefaultDependencies=no
+IgnoreOnIsolate=yes
 Requires=dbus.socket
 
 [Service]
index aca6631..794f0ba 100644 (file)
@@ -54,6 +54,8 @@ DBUS_PRIVATE_EXPORT
 DBusConnection *  _dbus_connection_ref_unlocked                (DBusConnection     *connection);
 DBUS_PRIVATE_EXPORT
 void              _dbus_connection_unref_unlocked              (DBusConnection     *connection);
+DBUS_PRIVATE_EXPORT
+dbus_uint32_t     _dbus_connection_get_next_client_serial      (DBusConnection *connection);
 void              _dbus_connection_queue_received_message_link (DBusConnection     *connection,
                                                                 DBusList           *link);
 dbus_bool_t       _dbus_connection_has_messages_to_send_unlocked (DBusConnection     *connection);
index e010579..7fa0ca0 100644 (file)
@@ -1503,7 +1503,16 @@ _dbus_connection_unref_unlocked (DBusConnection *connection)
     _dbus_connection_last_unref (connection);
 }
 
-static dbus_uint32_t
+/**
+ * Allocate and return the next non-zero serial number for outgoing messages.
+ *
+ * This method is only valid to call from single-threaded code, such as
+ * the dbus-daemon, or with the connection lock held.
+ *
+ * @param connection the connection
+ * @returns A suitable serial number for the next message to be sent on the connection.
+ */
+dbus_uint32_t
 _dbus_connection_get_next_client_serial (DBusConnection *connection)
 {
   dbus_uint32_t serial;