From: Lennart Poettering Date: Fri, 12 Feb 2021 22:39:49 +0000 (+0100) Subject: core: slightly improve error message on load errors X-Git-Tag: v248-rc1~145 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b10a2e03033738844a882c3d4fb46a08e8c26a1;p=thirdparty%2Fsystemd.git core: slightly improve error message on load errors Let's be a bit more helpful when refusing jobs on units that failed to load properly. We already have explicit D-Bus errors for the error conditions that are common and expected (such as "not found"), but for the rest we so far generate a fairly cryptic message. Let's try to be friendlier towards users and suggest what to do on such errors. Fixes: #16487 --- diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index 90bf5514a3e..8d92a4e763f 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -2356,7 +2356,8 @@ int bus_unit_validate_load_state(Unit *u, sd_bus_error *error) { return sd_bus_error_setf(error, BUS_ERROR_BAD_UNIT_SETTING, "Unit %s has a bad unit file setting.", u->id); case UNIT_ERROR: /* Only show .load_error in UNIT_ERROR state */ - return sd_bus_error_set_errnof(error, u->load_error, "Unit %s failed to load properly: %m.", u->id); + return sd_bus_error_set_errnof(error, u->load_error, + "Unit %s failed to load properly, please adjust/correct and reload service manager: %m", u->id); case UNIT_MASKED: return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit %s is masked.", u->id);