-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <libaudit.h>
#include <sys/types.h>
#include <unistd.h>
}
if (!(reply = dbus_connection_send_with_reply_and_block(c->bus, m, -1, &error))) {
- log_error("Failed to send command: %s", error.message);
+ log_error("Failed to send command: %s", bus_error_message(&error));
goto finish;
}
const char *special;
} table[] = {
/* The first target of this list that is active or has
- * a job scheduled wins */
+ * a job scheduled wins. We prefer runlevels 5 and 3
+ * here over the others, since these are the main
+ * runlevels used on Fedora. It might make sense to
+ * change the order on some distributions. */
{ '5', SPECIAL_RUNLEVEL5_TARGET },
- { '4', SPECIAL_RUNLEVEL4_TARGET },
{ '3', SPECIAL_RUNLEVEL3_TARGET },
+ { '4', SPECIAL_RUNLEVEL4_TARGET },
{ '2', SPECIAL_RUNLEVEL2_TARGET },
- { '1', SPECIAL_RESCUE_TARGET },
+ { 'S', SPECIAL_RESCUE_TARGET },
};
const char
*interface = "org.freedesktop.systemd1.Unit",
if (!dbus_message_get_args(reply, &error,
DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID)) {
- log_error("Failed to parse reply: %s", error.message);
+ log_error("Failed to parse reply: %s", bus_error_message(&error));
r = -EIO;
goto finish;
}
dbus_message_unref(reply);
if (!(reply = dbus_connection_send_with_reply_and_block(c->bus, m, -1, &error))) {
- log_error("Failed to send command: %s", error.message);
+ log_error("Failed to send command: %s", bus_error_message(&error));
r = -EIO;
goto finish;
}
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
+ log_open();
#ifdef HAVE_AUDIT
if ((c.audit_fd = audit_open()) < 0)
#endif
if (bus_connect(DBUS_BUS_SYSTEM, &c.bus, NULL, &error) < 0) {
- log_error("Failed to get D-Bus connection: %s", error.message);
+ log_error("Failed to get D-Bus connection: %s", bus_error_message(&error));
r = -EIO;
goto finish;
}