chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
journald: fix _SYSTEMD_CGROUP= values
[elogind.git]
/
src
/
systemctl.c
diff --git
a/src/systemctl.c
b/src/systemctl.c
index b0baf8dc5f1349ff37d49eccb9dfe6b123660b03..10e3991745a59878ab10d48fcdc5359f55458b63 100644
(file)
--- a/
src/systemctl.c
+++ b/
src/systemctl.c
@@
-58,6
+58,7
@@
#include "pager.h"
#include "spawn-agent.h"
#include "install.h"
#include "pager.h"
#include "spawn-agent.h"
#include "install.h"
+#include "logs-show.h"
static const char *arg_type = NULL;
static char **arg_property = NULL;
static const char *arg_type = NULL;
static char **arg_property = NULL;
@@
-377,8
+378,7
@@
static void output_units_list(const struct unit_info *unit_infos, unsigned c) {
n_shown++;
n_shown++;
- if (!streq(u->load_state, "loaded") &&
- !streq(u->load_state, "banned")) {
+ if (streq(u->load_state, "error")) {
on_loaded = ansi_highlight(true);
off_loaded = ansi_highlight(false);
} else
on_loaded = ansi_highlight(true);
off_loaded = ansi_highlight(false);
} else
@@
-622,8
+622,6
@@
static int list_unit_files(DBusConnection *bus, char **args) {
dbus_error_init(&error);
dbus_error_init(&error);
- assert(bus);
-
pager_open_if_enabled();
if (avoid_bus()) {
pager_open_if_enabled();
if (avoid_bus()) {
@@
-659,6
+657,8
@@
static int list_unit_files(DBusConnection *bus, char **args) {
hashmap_free(h);
} else {
hashmap_free(h);
} else {
+ assert(bus);
+
m = dbus_message_new_method_call(
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
m = dbus_message_new_method_call(
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
@@
-2063,8
+2063,7
@@
static void print_status_info(UnitStatusInfo *i) {
if (i->following)
printf("\t Follow: unit currently follows state of %s\n", i->following);
if (i->following)
printf("\t Follow: unit currently follows state of %s\n", i->following);
- if (streq_ptr(i->load_state, "failed") ||
- streq_ptr(i->load_state, "banned")) {
+ if (streq_ptr(i->load_state, "error")) {
on = ansi_highlight(true);
off = ansi_highlight(false);
} else
on = ansi_highlight(true);
off = ansi_highlight(false);
} else
@@
-2201,7
+2200,7
@@
static void print_status_info(UnitStatusInfo *i) {
if (i->running) {
char *t = NULL;
if (i->running) {
char *t = NULL;
- get_process_
name
(i->main_pid, &t);
+ get_process_
comm
(i->main_pid, &t);
if (t) {
printf(" (%s)", t);
free(t);
if (t) {
printf(" (%s)", t);
free(t);
@@
-2235,7
+2234,7
@@
static void print_status_info(UnitStatusInfo *i) {
printf(" Control: %u", (unsigned) i->control_pid);
printf(" Control: %u", (unsigned) i->control_pid);
- get_process_
name
(i->control_pid, &t);
+ get_process_
comm
(i->control_pid, &t);
if (t) {
printf(" (%s)", t);
free(t);
if (t) {
printf(" (%s)", t);
free(t);
@@
-2263,6
+2262,9
@@
static void print_status_info(UnitStatusInfo *i) {
}
}
}
}
+ if (i->id && arg_transport != TRANSPORT_SSH)
+ show_journal_by_service(i->id, OUTPUT_SHORT, NULL, 0, 0, 0, arg_all);
+
if (i->need_daemon_reload)
printf("\n%sWarning:%s Unit file changed on disk, 'systemctl %s daemon-reload' recommended.\n",
ansi_highlight(true),
if (i->need_daemon_reload)
printf("\n%sWarning:%s Unit file changed on disk, 'systemctl %s daemon-reload' recommended.\n",
ansi_highlight(true),
@@
-3462,7
+3464,7
@@
finish:
static int enable_sysv_units(char **args) {
int r = 0;
static int enable_sysv_units(char **args) {
int r = 0;
-#if defined (HAVE_SYSV_COMPAT) && (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX))
+#if defined (HAVE_SYSV_COMPAT) && (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX)
|| defined(TARGET_MAGEIA)
)
const char *verb = args[0];
unsigned f = 1, t = 1;
LookupPaths paths;
const char *verb = args[0];
unsigned f = 1, t = 1;
LookupPaths paths;
@@
-5000,7
+5002,8
@@
static int systemctl_main(DBusConnection *bus, int argc, char *argv[], DBusError
* enable/disable */
if (!streq(verbs[i].verb, "enable") &&
!streq(verbs[i].verb, "disable") &&
* enable/disable */
if (!streq(verbs[i].verb, "enable") &&
!streq(verbs[i].verb, "disable") &&
- !streq(verbs[i].verb, "is-enable") &&
+ !streq(verbs[i].verb, "is-enabled") &&
+ !streq(verbs[i].verb, "list-unit-files") &&
!streq(verbs[i].verb, "reenable") &&
!streq(verbs[i].verb, "preset") &&
!streq(verbs[i].verb, "mask") &&
!streq(verbs[i].verb, "reenable") &&
!streq(verbs[i].verb, "preset") &&
!streq(verbs[i].verb, "mask") &&
@@
-5156,7
+5159,7
@@
static int halt_main(DBusConnection *bus) {
if (!arg_no_wtmp) {
if (sd_booted() > 0)
log_debug("Not writing utmp record, assuming that systemd-update-utmp is used.");
if (!arg_no_wtmp) {
if (sd_booted() > 0)
log_debug("Not writing utmp record, assuming that systemd-update-utmp is used.");
- else if ((r = utmp_put_shutdown(
0
)) < 0)
+ else if ((r = utmp_put_shutdown()) < 0)
log_warning("Failed to write utmp record: %s", strerror(-r));
}
log_warning("Failed to write utmp record: %s", strerror(-r));
}