[systemd-commits] 3 commits - TODO src/core src/login

Lennart Poettering lennart at kemper.freedesktop.org
Sat Jun 30 02:27:22 PDT 2012


 TODO                    |    8 +++-----
 src/core/manager.c      |   16 ++++++++++++++++
 src/login/logind-dbus.c |   20 ++++++++++++++++++++
 3 files changed, 39 insertions(+), 5 deletions(-)

New commits:
commit 33c5fae93976505df343b842727f93910ad510c6
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jun 29 19:47:38 2012 +0200

    manager: serialize/deserialize job counters across reexec/reload

diff --git a/TODO b/TODO
index 4b7dad9..1a7b60e 100644
--- a/TODO
+++ b/TODO
@@ -29,8 +29,6 @@ Features:
 
 * document that journal data is primarily ASCII, UTF-8 where necessary and binary only where nothing else makes sense.
 
-* on reload/reexec: serialize NInstalledJobs properly
-
 * Document:
         - PID 1 D-Bus API
         - Update Syslog Interface docs
diff --git a/src/core/manager.c b/src/core/manager.c
index 9dfcb98..c0cc1b3 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1745,6 +1745,8 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds) {
 
         fprintf(f, "current-job-id=%i\n", m->current_job_id);
         fprintf(f, "taint-usr=%s\n", yes_no(m->taint_usr));
+        fprintf(f, "n-installed-jobs=%u\n", m->n_installed_jobs);
+        fprintf(f, "n-failed-jobs=%u\n", m->n_failed_jobs);
 
         dual_timestamp_serialize(f, "initrd-timestamp", &m->initrd_timestamp);
 
@@ -1820,6 +1822,20 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
                                 log_debug("Failed to parse current job id value %s", l+15);
                         else
                                 m->current_job_id = MAX(m->current_job_id, id);
+                } else if (startswith(l, "n-installed-jobs=")) {
+                        uint32_t n;
+
+                        if (safe_atou32(l+17, &n) < 0)
+                                log_debug("Failed to parse installed jobs counter %s", l+17);
+                        else
+                                m->n_installed_jobs += n;
+                } else if (startswith(l, "n-failed-jobs=")) {
+                        uint32_t n;
+
+                        if (safe_atou32(l+14, &n) < 0)
+                                log_debug("Failed to parse failed jobs counter %s", l+14);
+                        else
+                                m->n_failed_jobs += n;
                 } else if (startswith(l, "taint-usr=")) {
                         int b;
 

commit 5e4a79da3ac3859c2a1295e019b95a1e5589b9c1
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jun 29 19:38:35 2012 +0200

    logind: add PreparingForShutdown/PreparingForSleep properties

diff --git a/TODO b/TODO
index d816bf9..4b7dad9 100644
--- a/TODO
+++ b/TODO
@@ -36,9 +36,7 @@ Features:
         - Update Syslog Interface docs
         - Journal C API manual pages
 
-* logind: export a bool property that tells user whether a
-  suspend/shutdown is currently scheduled, i.e. where are between
-  PrepareForSuspend(true) and PrepareForSuspend(false)
+* wiki: document logind's PreparingForShutdown, PreparingForSleep
 
 * support debian's console-setup logic
 
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 3cde831..a2ead86 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -209,6 +209,8 @@
         "  <property name=\"HandlePowerKey\" type=\"s\" access=\"read\"/>\n" \
         "  <property name=\"HandleSleepKey\" type=\"s\" access=\"read\"/>\n" \
         "  <property name=\"HandleLidSwitch\" type=\"s\" access=\"read\"/>\n" \
+        "  <property name=\"PreparingForShutdown\" type=\"b\" access=\"read\"/>\n" \
+        "  <property name=\"PreparingForSleep\" type=\"b\" access=\"read\"/>\n" \
         " </interface>\n"
 
 #define INTROSPECTION_BEGIN                                             \
@@ -273,6 +275,22 @@ static int bus_manager_append_inhibited(DBusMessageIter *i, const char *property
         return 0;
 }
 
+static int bus_manager_append_preparing(DBusMessageIter *i, const char *property, void *data) {
+        Manager *m = data;
+        dbus_bool_t b;
+
+        assert(i);
+        assert(property);
+
+        if (streq(property, "PreparingForShutdown"))
+                b = !!(m->delayed_what & INHIBIT_SHUTDOWN);
+        else
+                b = !!(m->delayed_what & INHIBIT_SLEEP);
+
+        dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b);
+        return 0;
+}
+
 static int bus_manager_create_session(Manager *m, DBusMessage *message, DBusMessage **_reply) {
         Session *session = NULL;
         User *user = NULL;
@@ -1266,6 +1284,8 @@ static const BusProperty bus_login_manager_properties[] = {
         { "HandlePowerKey",         bus_manager_append_handle_button,   "s",  offsetof(Manager, handle_power_key)    },
         { "HandleSleepKey",         bus_manager_append_handle_button,   "s",  offsetof(Manager, handle_sleep_key)    },
         { "HandleLidSwitch",        bus_manager_append_handle_button,   "s",  offsetof(Manager, handle_lid_switch)   },
+        { "PreparingForShutdown",   bus_manager_append_preparing,       "b",  0 },
+        { "PreparingForSleep",      bus_manager_append_preparing,       "b",  0 },
         { NULL, }
 };
 

commit 9d074e618db1d5cbfad24419dc678c4f23fc0410
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jun 29 19:15:12 2012 +0200

    update TODO

diff --git a/TODO b/TODO
index c51bfbe..d816bf9 100644
--- a/TODO
+++ b/TODO
@@ -25,6 +25,8 @@ Bugfixes:
 
 Features:
 
+* rename systemd-udev.service to systemd-udevd.service
+
 * document that journal data is primarily ASCII, UTF-8 where necessary and binary only where nothing else makes sense.
 
 * on reload/reexec: serialize NInstalledJobs properly



More information about the systemd-commits mailing list