1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-03 16:58:37 +03:00

systemctl: show sysv path if it is set if the fragment path isn't in systemctl status

This commit is contained in:
Lennart Poettering 2010-08-13 01:28:05 +02:00
parent 145b66acab
commit c31b4423a9
2 changed files with 16 additions and 11 deletions

4
fixme

@ -75,7 +75,9 @@
* plymouth after/before getty? * plymouth after/before getty?
* in systemctl show sysv init script path * D-Bus call GetUnitByPID
* be more forgiving when parsing unit files, when encountering incorrect lines with non assignments
External: External:

@ -1418,7 +1418,7 @@ typedef struct UnitStatusInfo {
const char *description; const char *description;
const char *fragment_path; const char *path;
const char *default_control_group; const char *default_control_group;
bool need_daemon_reload; bool need_daemon_reload;
@ -1467,15 +1467,16 @@ static void print_status_info(UnitStatusInfo *i) {
printf("\n"); printf("\n");
if (i->fragment_path) if (streq_ptr(i->load_state, "failed")) {
printf("\t Loaded: %s (%s)\n", strna(i->load_state), i->fragment_path); on = ansi_highlight(true);
else if (streq_ptr(i->load_state, "failed")) off = ansi_highlight(false);
printf("\t Loaded: %s%s%s\n", } else
ansi_highlight(true), on = off = "";
strna(i->load_state),
ansi_highlight(false)); if (i->path)
printf("\t Loaded: %s%s%s (%s)\n", on, strna(i->load_state), off, i->path);
else else
printf("\t Loaded: %s\n", strna(i->load_state)); printf("\t Loaded: %s%s%s\n", on, strna(i->load_state), off);
ss = streq_ptr(i->active_state, i->sub_state) ? NULL : i->sub_state; ss = streq_ptr(i->active_state, i->sub_state) ? NULL : i->sub_state;
@ -1623,7 +1624,9 @@ static int status_property(const char *name, DBusMessageIter *iter, UnitStatusIn
else if (streq(name, "Description")) else if (streq(name, "Description"))
i->description = s; i->description = s;
else if (streq(name, "FragmentPath")) else if (streq(name, "FragmentPath"))
i->fragment_path = s; i->path = s;
else if (streq(name, "SysVPath"))
i->path = s;
else if (streq(name, "DefaultControlGroup")) else if (streq(name, "DefaultControlGroup"))
i->default_control_group = s; i->default_control_group = s;
else if (streq(name, "StatusText")) else if (streq(name, "StatusText"))