chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: show whether we follow somebody in 'status' output
[elogind.git]
/
src
/
systemctl.c
diff --git
a/src/systemctl.c
b/src/systemctl.c
index 4beec0fca594d950e6af805d4e1aabad85b64aec..51f5bba84c4bc2f93ac7c5055fffdeddc57a0ccd 100644
(file)
--- a/
src/systemctl.c
+++ b/
src/systemctl.c
@@
-1568,6
+1568,7
@@
typedef struct UnitStatusInfo {
const char *sub_state;
const char *description;
const char *sub_state;
const char *description;
+ const char *following;
const char *path;
const char *default_control_group;
const char *path;
const char *default_control_group;
@@
-1629,6
+1630,9
@@
static void print_status_info(UnitStatusInfo *i) {
printf("\n");
printf("\n");
+ 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")) {
on = ansi_highlight(true);
if (streq_ptr(i->load_state, "failed") ||
streq_ptr(i->load_state, "banned")) {
on = ansi_highlight(true);
@@
-1841,6
+1845,8
@@
static int status_property(const char *name, DBusMessageIter *iter, UnitStatusIn
i->where = s;
else if (streq(name, "What"))
i->what = s;
i->where = s;
else if (streq(name, "What"))
i->what = s;
+ else if (streq(name, "Following"))
+ i->following = s;
}
break;
}
break;
@@
-3247,7
+3253,7
@@
static int install_info_add(const char *name) {
assert(will_install);
assert(will_install);
- if (!unit_name_is_valid_no_type(name)) {
+ if (!unit_name_is_valid_no_type(name
, true
)) {
log_warning("Unit name %s is not a valid unit name.", name);
return -EINVAL;
}
log_warning("Unit name %s is not a valid unit name.", name);
return -EINVAL;
}
@@
-3633,12
+3639,6
@@
static int install_info_symlink_alias(const char *verb, InstallInfo *i, const ch
STRV_FOREACH(s, i->aliases) {
STRV_FOREACH(s, i->aliases) {
- if (!unit_name_is_valid_no_type(*s)) {
- log_error("Invalid name %s.", *s);
- r = -EINVAL;
- goto finish;
- }
-
free(alias_path);
if (!(alias_path = path_make_absolute(*s, config_path))) {
log_error("Out of memory");
free(alias_path);
if (!(alias_path = path_make_absolute(*s, config_path))) {
log_error("Out of memory");
@@
-3670,7
+3670,7
@@
static int install_info_symlink_wants(const char *verb, InstallInfo *i, const ch
assert(config_path);
STRV_FOREACH(s, i->wanted_by) {
assert(config_path);
STRV_FOREACH(s, i->wanted_by) {
- if (!unit_name_is_valid_no_type(*s)) {
+ if (!unit_name_is_valid_no_type(*s
, true
)) {
log_error("Invalid name %s.", *s);
r = -EINVAL;
goto finish;
log_error("Invalid name %s.", *s);
r = -EINVAL;
goto finish;