summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-05-21 15:12:18 +0200
committerLennart Poettering <lennart@poettering.net>2012-05-21 15:14:51 +0200
commit49dbfa7b2b0bf3906704dac1eaeb4eba91056a19 (patch)
treeb7bf6ad5bef741f68b45a431807f58a81a5c845a /src/core/unit.c
parenta223b325b409b325f4c2c2e11268596edd842631 (diff)
units: introduce new Documentation= field and make use of it everywhere
This should help making the boot process a bit easier to explore and understand for the administrator. The simple idea is that "systemctl status" now shows a link to documentation alongside the other status and decriptionary information of a service. This patch adds the necessary fields to all our shipped units if we have proper documentation for them.
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 200d196878..1f1a5314f7 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -397,6 +397,7 @@ void unit_free(Unit *u) {
cgroup_attribute_free_list(u->cgroup_attributes);
free(u->description);
+ strv_free(u->documentation);
free(u->fragment_path);
free(u->instance);
@@ -624,7 +625,7 @@ const char *unit_description(Unit *u) {
}
void unit_dump(Unit *u, FILE *f, const char *prefix) {
- char *t;
+ char *t, **j;
UnitDependency d;
Iterator i;
char *p2;
@@ -672,6 +673,9 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
SET_FOREACH(t, u->names, i)
fprintf(f, "%s\tName: %s\n", prefix, t);
+ STRV_FOREACH(j, u->documentation)
+ fprintf(f, "%s\tDocumentation: %s\n", prefix, *j);
+
if ((following = unit_following(u)))
fprintf(f, "%s\tFollowing: %s\n", prefix, following->id);
@@ -698,8 +702,6 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
}
if (!strv_isempty(u->requires_mounts_for)) {
- char **j;
-
fprintf(f,
"%s\tRequiresMountsFor:", prefix);