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.
This commit is contained in:
Lennart Poettering
2012-05-21 15:14:51 +02:00
parent a223b325b4
commit 49dbfa7b2b
91 changed files with 312 additions and 107 deletions
+21
View File
@@ -5610,3 +5610,24 @@ int can_sleep(const char *type) {
free(p);
return found;
}
bool is_valid_documentation_url(const char *url) {
assert(url);
if (startswith(url, "http://") && url[7])
return true;
if (startswith(url, "https://") && url[8])
return true;
if (startswith(url, "file:") && url[5])
return true;
if (startswith(url, "info:") && url[5])
return true;
if (startswith(url, "man:") && url[4])
return true;
return false;
}
+2
View File
@@ -508,4 +508,6 @@ int getenv_for_pid(pid_t pid, const char *field, char **_value);
int can_sleep(const char *type);
bool is_valid_documentation_url(const char *url);
#endif