From 8c62ad19290ff9239f5c399173eacb676169922b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Dec 2020 23:51:04 +0100 Subject: [PATCH] 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 --- src/shared/bus-wait-for-jobs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/shared/bus-wait-for-jobs.c b/src/shared/bus-wait-for-jobs.c index b2a9e031ce..005294c33a 100644 --- a/src/shared/bus-wait-for-jobs.c +++ b/src/shared/bus-wait-for-jobs.c @@ -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 ?: "", - journalctl); + journalctl, + service_shell_quoted ?: ""); 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 ?: "", - journalctl); + journalctl, + service_shell_quoted ?: ""); finish: /* For some results maybe additional explanation is required */