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

Lennart Poettering lennart at kemper.freedesktop.org
Tue Nov 20 10:14:18 PST 2012


 TODO                     |    9 +++++++++
 src/login/logind-dbus.c  |    4 ++--
 src/shared/dbus-common.c |   13 +++++++++++--
 src/shared/dbus-common.h |    4 ++++
 4 files changed, 26 insertions(+), 4 deletions(-)

New commits:
commit e9fd44b728ff1fc0d1f24fccb87a767f6865df27
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Nov 20 19:13:54 2012 +0100

    update TODO

diff --git a/TODO b/TODO
index ff52822..f8062f2 100644
--- a/TODO
+++ b/TODO
@@ -19,6 +19,10 @@ F18:
 
 Features:
 
+* check if we can make journalctl by default use --follow mode inside of less if called without args?
+
+* Addd a verbose mode to "systemctl start" and friends that explains what is being done or not done
+
 * "systemctl is-failed" to join "systemctl is-active" and "systemctl is-enabled".
 
 * journal is not closed properly at shutdown when run in a container?

commit 3040728b6691ea2e9df3a2060e2d49a792bbaeda
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Nov 20 19:11:55 2012 +0100

    update TODO

diff --git a/TODO b/TODO
index 86eea94..ff52822 100644
--- a/TODO
+++ b/TODO
@@ -19,6 +19,10 @@ F18:
 
 Features:
 
+* "systemctl is-failed" to join "systemctl is-active" and "systemctl is-enabled".
+
+* journal is not closed properly at shutdown when run in a container?
+
 * All log messages generated from socket.c, service.c, ... should
   include _SYSTEMD_UNIT= fields so that "systemctl status" can show
   them along with the unit
@@ -518,6 +522,7 @@ Features:
   - how to develop against journal browsing APIs
   - the journal HTTP iface
   - non-cgroup resource management
+  - refreshed, longer missions statement
 
 * allow port=0 in .socket units
 

commit 1a37b9b9043ef83e9900e460a9a1fccced3acf89
Author: Colin Walters <walters at verbum.org>
Date:   Tue Oct 30 15:38:32 2012 -0400

    dbus-common: Add helper method to handle no-reply messages
    
    [Tested in latest gnome-ostree; if accepted, I'll look at a followup
     patch which fixes the other dbus_connection_send(reply, ...) calls
     besides logind]
    
    DBus messages can have a flag NO_REPLY associated that means "I don't
    need a reply".  This is for efficiency reasons - for one-off requests
    that can't return an error, etc.
    
    However, it's up to users to manually check
    dbus_message_get_no_reply() from a message.  libdbus will happily send
    out a reply if you don't.
    
    Unfortunately, doing so is not just less efficient - it also triggers
    a security error, for complex reasons.  This is something that will
    eventually be fixed in dbus, but it's also correct to handle it in
    client applications.
    
    This new helper API is slightly nicer in that you don't have to pass
    NULL to say you don't want a reply serial for your reply.
    
    This patch also tweaks logind to use the API - there are more areas of
    the code that need this treatment too.

diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 8b6021d..89021ab 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2276,8 +2276,8 @@ static DBusHandlerResult manager_message_handler(
         }
 
         if (reply) {
-                if (!dbus_connection_send(connection, reply, NULL))
-                        goto oom;
+                if (!bus_maybe_send_reply(connection, message, reply))
+                                goto oom;
 
                 dbus_message_unref(reply);
         }
diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c
index ee281e5..e9a78c2 100644
--- a/src/shared/dbus-common.c
+++ b/src/shared/dbus-common.c
@@ -501,7 +501,7 @@ set_prop:
         }
 
         if (reply) {
-                if (!dbus_connection_send(c, reply, NULL))
+                if (!bus_maybe_send_reply(c, message, reply))
                         goto oom;
 
                 return DBUS_HANDLER_RESULT_HANDLED;
@@ -713,6 +713,15 @@ const char *bus_errno_to_dbus(int error) {
         return DBUS_ERROR_FAILED;
 }
 
+dbus_bool_t bus_maybe_send_reply (DBusConnection   *c,
+                                  DBusMessage *message,
+                                  DBusMessage *reply)
+{
+        if (dbus_message_get_no_reply (message))
+                return TRUE;
+        return dbus_connection_send (c, reply, NULL);
+}
+
 DBusHandlerResult bus_send_error_reply(DBusConnection *c, DBusMessage *message, DBusError *berror, int error) {
         _cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
         const char *name, *text;
@@ -729,7 +738,7 @@ DBusHandlerResult bus_send_error_reply(DBusConnection *c, DBusMessage *message,
         if (!reply)
                 goto oom;
 
-        if (!dbus_connection_send(c, reply, NULL))
+        if (!bus_maybe_send_reply(c, message, reply))
                 goto oom;
 
         if (berror)
diff --git a/src/shared/dbus-common.h b/src/shared/dbus-common.h
index 005a715..3b7ae16 100644
--- a/src/shared/dbus-common.h
+++ b/src/shared/dbus-common.h
@@ -113,6 +113,10 @@ typedef struct BusBoundProperties {
         const void *const base;          /* base pointer to which the offset must be added to reach data */
 } BusBoundProperties;
 
+dbus_bool_t bus_maybe_send_reply (DBusConnection   *c,
+                                  DBusMessage *message,
+                                  DBusMessage *reply);
+
 DBusHandlerResult bus_send_error_reply(
                 DBusConnection *c,
                 DBusMessage *message,



More information about the systemd-commits mailing list