summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-03-21 19:08:46 +0100
committerLennart Poettering <lennart@poettering.net>2018-04-13 11:34:48 +0200
commit952713b07a85fe1b1f645659b872abeaf71e2f11 (patch)
treee462027cf71e719783c09ac598bcf42cfc06677f
parentload-dropin: rename variable (diff)
downloadsystemd-952713b07a85fe1b1f645659b872abeaf71e2f11.tar.xz
systemd-952713b07a85fe1b1f645659b872abeaf71e2f11.zip
dropin: don't fully suppress logging about ENAMETOOLONG. Just downgrade to LOG_DEBUG
-rw-r--r--src/shared/dropin.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/shared/dropin.c b/src/shared/dropin.c
index 9544cab0b0..7719059624 100644
--- a/src/shared/dropin.c
+++ b/src/shared/dropin.c
@@ -115,14 +115,16 @@ static int unit_file_find_dir(
assert(path);
r = chase_symlinks(path, original_root, 0, &chased);
- /* Ignore -ENOENT, after all most units won't have a drop-in dir.
- * Also ignore -ENAMETOOLONG, users are not even able to create
- * the drop-in dir in such case. This mostly happens for device units with long /sys path.
- * */
- if (IN_SET(r, -ENOENT, -ENAMETOOLONG))
+ if (r == -ENOENT) /* Ignore -ENOENT, after all most units won't have a drop-in dir. */
return 0;
+ if (r == -ENAMETOOLONG) {
+ /* Also, ignore -ENAMETOOLONG but log about it. After all, users are not even able to create the
+ * drop-in dir in such case. This mostly happens for device units with an overly long /sys path. */
+ log_debug_errno(r, "Path '%s' too long, couldn't canonicalize, ignoring.", path);
+ return 0;
+ }
if (r < 0)
- return log_full_errno(LOG_WARNING, r, "Failed to canonicalize path %s: %m", path);
+ return log_warning_errno(r, "Failed to canonicalize path '%s': %m", path);
r = strv_push(dirs, chased);
if (r < 0)