Improve instructions for debugging failing service

In situations where a service fails to start, systemd suggests the user to
use "journalctl -xe" to get details about the failure. While running this
command does provide some additional details, most of the information is
similar to what was already printed when the service fails.

often the actual reason for the failure can be found in the logs of the
service that fails to start.

This patch updates the wording to suggest using "-u" to view the service
logs instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-12-23 23:51:04 +01:00 committed by Yu Watanabe
parent bc1a4d28bb
commit 8c62ad1929
1 changed files with 6 additions and 4 deletions

View File

@ -200,22 +200,24 @@ static void log_job_error_with_service_result(const char* service, const char *r
if (i < ELEMENTSOF(explanations)) {
log_error("Job for %s failed because %s.\n"
"See \"%s status %s\" and \"%s -xe\" for details.\n",
"See \"%s status %s\" and \"%s -xeu %s\" for details.\n",
service,
explanations[i].explanation,
systemctl,
service_shell_quoted ?: "<service>",
journalctl);
journalctl,
service_shell_quoted ?: "<service>");
goto finish;
}
}
log_error("Job for %s failed.\n"
"See \"%s status %s\" and \"%s -xe\" for details.\n",
"See \"%s status %s\" and \"%s -xeu %s\" for details.\n",
service,
systemctl,
service_shell_quoted ?: "<service>",
journalctl);
journalctl,
service_shell_quoted ?: "<service>");
finish:
/* For some results maybe additional explanation is required */