summaryrefslogtreecommitdiff
path: root/src/core/mount.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-09-26 23:35:58 +0200
committerLennart Poettering <lennart@poettering.net>2017-09-27 18:26:18 +0200
commited77d407d3766e78f96c848aed04da50a0ac7d42 (patch)
tree0cba4eb5acb61af2b2c10e8bceb642a112cc31cd /src/core/mount.c
parent84b26d5149e227af14126eee744bfd6dae7afb35 (diff)
downloadsystemd-ed77d407d3766e78f96c848aed04da50a0ac7d42.tar.gz
core: log unit failure with type-specific result code
This slightly changes how we log about failures. Previously, service_enter_dead() would log that a service unit failed along with its result code, and unit_notify() would do this again but without the result code. For other unit types only the latter would take effect. This cleans this up: we keep the message in unit_notify() only for debug purposes, and add type-specific log lines to all our unit types that can fail, and always place them before unit_notify() is invoked. Or in other words: the duplicate log message for service units is removed, and all other unit types get a more useful line with the precise result code.
Diffstat (limited to 'src/core/mount.c')
-rw-r--r--src/core/mount.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index 22b3608a2f..903b3a9c1b 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -796,6 +796,9 @@ static void mount_enter_dead(Mount *m, MountResult f) {
if (m->result == MOUNT_SUCCESS)
m->result = f;
+ if (m->result != MOUNT_SUCCESS)
+ log_unit_warning(UNIT(m), "Failed with result '%s'.", mount_result_to_string(m->result));
+
mount_set_state(m, m->result != MOUNT_SUCCESS ? MOUNT_FAILED : MOUNT_DEAD);
exec_runtime_destroy(m->exec_runtime);