[systemd-commits] 2 commits - configure.ac src/systemctl

Lennart Poettering lennart at kemper.freedesktop.org
Mon Sep 30 18:30:34 PDT 2013


 configure.ac              |    2 
 src/systemctl/systemctl.c |   93 ----------------------------------------------
 2 files changed, 1 insertion(+), 94 deletions(-)

New commits:
commit abaaabf40a9891014ed4c402d7beb5a67ac256b1
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Oct 1 03:22:41 2013 +0200

    build-sys: don't fallback to upstart defaults

diff --git a/configure.ac b/configure.ac
index 45526f4..4c7fa23 100644
--- a/configure.ac
+++ b/configure.ac
@@ -808,7 +808,7 @@ AC_ARG_WITH(telinit,
         AS_HELP_STRING([--with-telinit=PATH],
                 [Path to telinit]),
         [TELINIT="$withval"],
-        [TELINIT="/lib/upstart/telinit"])
+        [TELINIT="/lib/sysvinit/telinit"])
 
 AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
 

commit ba5ecfcdbb4a4aa05f5040f847c207fd0df5de4f
Author: Cristian Rodríguez <crrodriguez at opensuse.org>
Date:   Sun Sep 29 23:17:42 2013 -0300

    systemctl: remove legacy upstart compatibility

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index eede616..bb7ada9 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5678,94 +5678,6 @@ _pure_ static int action_to_runlevel(void) {
         return table[arg_action];
 }
 
-static int talk_upstart(void) {
-        _cleanup_dbus_message_unref_ DBusMessage *m = NULL, *reply = NULL;
-        _cleanup_dbus_error_free_ DBusError error;
-        int previous, rl, r;
-        char
-                env1_buf[] = "RUNLEVEL=X",
-                env2_buf[] = "PREVLEVEL=X";
-        char *env1 = env1_buf, *env2 = env2_buf;
-        const char *emit = "runlevel";
-        dbus_bool_t b_false = FALSE;
-        DBusMessageIter iter, sub;
-        DBusConnection *bus;
-
-        dbus_error_init(&error);
-
-        if (!(rl = action_to_runlevel()))
-                return 0;
-
-        if (utmp_get_runlevel(&previous, NULL) < 0)
-                previous = 'N';
-
-        if (!(bus = dbus_connection_open_private("unix:abstract=/com/ubuntu/upstart", &error))) {
-                if (dbus_error_has_name(&error, DBUS_ERROR_NO_SERVER)) {
-                        r = 0;
-                        goto finish;
-                }
-
-                log_error("Failed to connect to Upstart bus: %s", bus_error_message(&error));
-                r = -EIO;
-                goto finish;
-        }
-
-        if ((r = bus_check_peercred(bus)) < 0) {
-                log_error("Failed to verify owner of bus.");
-                goto finish;
-        }
-
-        if (!(m = dbus_message_new_method_call(
-                              "com.ubuntu.Upstart",
-                              "/com/ubuntu/Upstart",
-                              "com.ubuntu.Upstart0_6",
-                              "EmitEvent"))) {
-
-                log_error("Could not allocate message.");
-                r = -ENOMEM;
-                goto finish;
-        }
-
-        dbus_message_iter_init_append(m, &iter);
-
-        env1_buf[sizeof(env1_buf)-2] = rl;
-        env2_buf[sizeof(env2_buf)-2] = previous;
-
-        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &emit) ||
-            !dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &sub) ||
-            !dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &env1) ||
-            !dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &env2) ||
-            !dbus_message_iter_close_container(&iter, &sub) ||
-            !dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &b_false)) {
-                log_error("Could not append arguments to message.");
-                r = -ENOMEM;
-                goto finish;
-        }
-
-        if (!(reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error))) {
-
-                if (bus_error_is_no_service(&error)) {
-                        r = -EADDRNOTAVAIL;
-                        goto finish;
-                }
-
-                log_error("Failed to issue method call: %s", bus_error_message(&error));
-                r = -EIO;
-                goto finish;
-        }
-
-        r = 1;
-
-finish:
-        if (bus) {
-                dbus_connection_flush(bus);
-                dbus_connection_close(bus);
-                dbus_connection_unref(bus);
-        }
-
-        return r;
-}
-
 static int talk_initctl(void) {
         struct init_request request = {};
         int r;
@@ -6037,11 +5949,6 @@ static int start_with_fallback(DBusConnection *bus) {
                         goto done;
         }
 
-        /* Hmm, talking to systemd via D-Bus didn't work. Then
-         * let's try to talk to Upstart via D-Bus. */
-        if (talk_upstart() > 0)
-                goto done;
-
         /* Nothing else worked, so let's try
          * /dev/initctl */
         if (talk_initctl() > 0)



More information about the systemd-commits mailing list