Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package wtmpdb for openSUSE:Factory checked 
in at 2026-10-18 22:54:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/wtmpdb (Old)
 and      /work/SRC/openSUSE:Factory/.wtmpdb.new.3698736 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "wtmpdb"

Sun Oct 18 22:54:06 2026 rev:27 rq:1385200 version:0.76.0+git20261016.cab5ed0

Changes:
--------
--- /work/SRC/openSUSE:Factory/wtmpdb/wtmpdb.changes    2026-08-01 
18:30:09.437461640 +0200
+++ /work/SRC/openSUSE:Factory/.wtmpdb.new.3698736/wtmpdb.changes       
2026-10-18 22:54:08.769189179 +0200
@@ -1,0 +2,7 @@
+Fri Oct 16 13:40:25 UTC 2026 - Thorsten Kukuk <[email protected]>
+
+- Update to version 0.76.0+git20261016.cab5ed0:
+  * Try first varlink to get soft_reboots_count, increase count size
+  * Use DefaultDependencies=no [bsc#1284234]
+
+-------------------------------------------------------------------

Old:
----
  wtmpdb-0.76.0+git20260730.89c0861.tar.xz

New:
----
  wtmpdb-0.76.0+git20261016.cab5ed0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ wtmpdb.spec ++++++
--- /var/tmp/diff_new_pack.VfipR8/_old  2026-10-18 22:54:09.578223046 +0200
+++ /var/tmp/diff_new_pack.VfipR8/_new  2026-10-18 22:54:09.579223088 +0200
@@ -18,7 +18,7 @@
 
 %define lname   libwtmpdb0
 Name:           wtmpdb
-Version:        0.76.0+git20260730.89c0861
+Version:        0.76.0+git20261016.cab5ed0
 Release:        0
 Summary:        Database for recording the last logged in users and system 
reboots
 License:        BSD-2-Clause

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.VfipR8/_old  2026-10-18 22:54:09.619224763 +0200
+++ /var/tmp/diff_new_pack.VfipR8/_new  2026-10-18 22:54:09.622224888 +0200
@@ -4,6 +4,6 @@
 </service>
 <service name="tar_scm">
                 <param name="url">https://github.com/thkukuk/wtmpdb.git</param>
-              <param 
name="changesrevision">89c0861f74e576c5ad0ec9f5302aa635a4e50dc6</param></service></servicedata>
+              <param 
name="changesrevision">cab5ed0ec11828c4f05ca7a692413e902946de57</param></service></servicedata>
 (No newline at EOF)
 

++++++ wtmpdb-0.76.0+git20260730.89c0861.tar.xz -> 
wtmpdb-0.76.0+git20261016.cab5ed0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wtmpdb-0.76.0+git20260730.89c0861/src/wtmpdb.c 
new/wtmpdb-0.76.0+git20261016.cab5ed0/src/wtmpdb.c
--- old/wtmpdb-0.76.0+git20260730.89c0861/src/wtmpdb.c  2026-07-30 
14:48:03.000000000 +0200
+++ new/wtmpdb-0.76.0+git20261016.cab5ed0/src/wtmpdb.c  2026-10-16 
14:41:43.000000000 +0200
@@ -48,6 +48,10 @@
 #if HAVE_SYSTEMD
 #include <systemd/sd-bus.h>
 #define _cleanup_(f) __attribute__((cleanup(f)))
+#if WITH_WTMPDBD
+#include <systemd/sd-json.h>
+#include <systemd/sd-varlink.h>
+#endif
 #endif
 
 #include "import.h"
@@ -978,6 +982,47 @@
 }
 
 #if HAVE_SYSTEMD
+#if WITH_WTMPDBD
+#define _VARLINK_MANAGER_SOCKET "/run/systemd/io.systemd.Manager"
+
+/* Find out if it was a soft-reboot via the io.systemd.Manager varlink
+   interface (io.systemd.Manager.Describe).
+   Return values:
+   -1: varlink interface not available (too old systemd or no varlink support)
+   0: no soft-reboot
+   >0: number of soft-reboots
+*/
+static int64_t
+soft_reboots_count_varlink(void)
+{
+  _cleanup_(sd_varlink_unrefp) sd_varlink *link = NULL;
+  sd_json_variant *result, *runtime, *count;
+  const char *error_id;
+  int r;
+
+  r = sd_varlink_connect_address(&link, _VARLINK_MANAGER_SOCKET);
+  if (r < 0)
+    return -1;
+
+  r = sd_varlink_call(link, "io.systemd.Manager.Describe", NULL,
+                     &result, &error_id);
+  if (r < 0 || (error_id && strlen(error_id) > 0))
+    return -1;
+
+  runtime = sd_json_variant_by_key(result, "runtime");
+  if (!runtime || !sd_json_variant_is_object(runtime))
+    return -1;
+
+  count = sd_json_variant_by_key(runtime, "SoftRebootsCount");
+  if (!count || !sd_json_variant_is_unsigned(count))
+    return -1; // too old systemd, property doesn't exist yet
+
+  /* theoretical this could be integer overflow, bug since
+     the soft reboot counter of systemd is only uint32_t we are safe here */
+  return sd_json_variant_unsigned(count);
+}
+#endif
+
 /* Find out if it was a soft-reboot. With systemd v256 we can query systemd
    for this.
    Return values:
@@ -985,24 +1030,22 @@
    0: no soft-reboot
    >0: number of soft-reboots
 */
-static int
-soft_reboots_count (void)
+static int64_t
+soft_reboots_count_dbus(void)
 {
-  unsigned soft_reboots_count = -1;
+  unsigned soft_reboots_count = 0;
   _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
   sd_bus_error error = SD_BUS_ERROR_NULL;
   int r;
 
-  if (sd_bus_open_system (&bus) < 0)
-    {
-      return -1;
-    }
+  if (sd_bus_open_system(&bus) < 0)
+    return -1;
 
-  r = sd_bus_get_property_trivial (bus, "org.freedesktop.systemd1",
-                                  "/org/freedesktop/systemd1",
-                                  "org.freedesktop.systemd1.Manager",
-                                  "SoftRebootsCount",
-                                  &error, 'u', &soft_reboots_count);
+  r = sd_bus_get_property_trivial(bus, "org.freedesktop.systemd1",
+                                 "/org/freedesktop/systemd1",
+                                 "org.freedesktop.systemd1.Manager",
+                                 "SoftRebootsCount",
+                                 &error, 'u', &soft_reboots_count);
   if (r < 0)
     {
       /* no systemd or systemd is too old: don't print error */
@@ -1020,6 +1063,21 @@
     }
   return soft_reboots_count;
 }
+
+/* Find out if it was a soft-reboot. Prefers the io.systemd.Manager
+   varlink interface and falls back to D-Bus if that is not available.
+   Return values: see soft_reboots_count_dbus().
+*/
+static int64_t
+soft_reboots_count(void)
+{
+#if WITH_WTMPDBD
+  int64_t count = soft_reboots_count_varlink();
+  if (count >= 0)
+    return count;
+#endif
+  return soft_reboots_count_dbus ();
+}
 #endif
 
 static int
@@ -1077,7 +1135,7 @@
   struct timespec ts_empty = { .tv_sec = 0, .tv_nsec = 0 };
   uint64_t now = wtmpdb_timespec2usec (diff_timespec(&ts_now, &ts_empty));
 
-  int count = soft_reboots_count ();
+  int64_t count = soft_reboots_count ();
 
   if (count > 0)
     {
@@ -1103,7 +1161,7 @@
 #endif
 
 #if HAVE_AUDIT
-  log_audit (AUDIT_SYSTEM_BOOT);
+  log_audit(AUDIT_SYSTEM_BOOT);
 #endif
 
   if (wtmpdb_login (wtmpdb_path, BOOT_TIME, soft_reboot ? "soft-reboot" : 
"reboot", time, "~", uts.release,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wtmpdb-0.76.0+git20260730.89c0861/units/wtmpdbd.service 
new/wtmpdb-0.76.0+git20261016.cab5ed0/units/wtmpdbd.service
--- old/wtmpdb-0.76.0+git20260730.89c0861/units/wtmpdbd.service 2026-07-30 
14:48:03.000000000 +0200
+++ new/wtmpdb-0.76.0+git20261016.cab5ed0/units/wtmpdbd.service 2026-10-16 
14:41:43.000000000 +0200
@@ -1,6 +1,11 @@
 [Unit]
 Description=wtmpdb daemon
 Documentation=man:wtmpdbd(8)
+DefaultDependencies=no
+RequiresMountsFor=/var/lib/wtmpdb
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service
+Conflicts=shutdown.target
+Before=shutdown.target
 
 [Service]
 Type=notify

Reply via email to