[systemd-commits] src/cgroups-agent

Kay Sievers kay at kemper.freedesktop.org
Thu Jul 4 11:57:36 PDT 2013


 src/cgroups-agent/cgroups-agent.c |   19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

New commits:
commit c1eba3008cac9e625b8bb774e9b44ceec8465980
Author: Kay Sievers <kay at vrfy.org>
Date:   Thu Jul 4 20:54:40 2013 +0200

    cgroups-agent: remove ancient fallback code; turn connection error into warning
    
    During re-execution and shutdown cgroups agents might not be able
    to connect to systemd's private D-Bus socket, the printed error to
    the console is misleding in that case, so turn it into a warning.

diff --git a/src/cgroups-agent/cgroups-agent.c b/src/cgroups-agent/cgroups-agent.c
index 0e3d2b7..a47949a 100644
--- a/src/cgroups-agent/cgroups-agent.c
+++ b/src/cgroups-agent/cgroups-agent.c
@@ -48,26 +48,19 @@ int main(int argc, char *argv[]) {
          * this to avoid an activation loop when we start dbus when we
          * are called when the dbus service is shut down. */
 
-        if (!(bus = dbus_connection_open_private("unix:path=/run/systemd/private", &error))) {
-#ifndef NOLEGACY
-                dbus_error_free(&error);
-
-                /* Retry with the pre v21 socket name, to ease upgrades */
-                if (!(bus = dbus_connection_open_private("unix:abstract=/org/freedesktop/systemd1/private", &error))) {
-#endif
-                        log_error("Failed to get D-Bus connection: %s", bus_error_message(&error));
-                        goto finish;
-                }
-#ifndef NOLEGACY
+        bus = dbus_connection_open_private("unix:path=/run/systemd/private", &error);
+        if (!bus) {
+                log_warning("Failed to get D-Bus connection: %s", bus_error_message(&error));
+                goto finish;
         }
-#endif
 
         if (bus_check_peercred(bus) < 0) {
                 log_error("Bus owner not root.");
                 goto finish;
         }
 
-        if (!(m = dbus_message_new_signal("/org/freedesktop/systemd1/agent", "org.freedesktop.systemd1.Agent", "Released"))) {
+        m = dbus_message_new_signal("/org/freedesktop/systemd1/agent", "org.freedesktop.systemd1.Agent", "Released");
+        if (!m) {
                 log_error("Could not allocate signal message.");
                 goto finish;
         }



More information about the systemd-commits mailing list