1
0
mirror of https://github.com/systemd/systemd synced 2024-07-08 20:15:55 +00:00

sysctl: increase log severity on failed write

Increase the log severity in case of writing to a non existent sysctl
parameter as this can either be caused by a misspelling or a kernel mis-
configuration, e.g. in case YAMA does not get loaded due to a incomplete
lsm= override:

    systemd-sysctl[354]: Couldn't write '1' to 'kernel/yama/ptrace_scope', ignoring: No such file or directory
This commit is contained in:
Christian Göttsche 2022-06-13 16:01:04 +02:00 committed by Yu Watanabe
parent b0367874d5
commit 1805fbcf06

View File

@ -107,7 +107,7 @@ static int sysctl_write_or_warn(const char *key, const char *value, bool ignore_
if (ignore_failure || r == -EROFS || ERRNO_IS_PRIVILEGE(r))
log_debug_errno(r, "Couldn't write '%s' to '%s', ignoring: %m", value, key);
else if (r == -ENOENT)
log_info_errno(r, "Couldn't write '%s' to '%s', ignoring: %m", value, key);
log_warning_errno(r, "Couldn't write '%s' to '%s', ignoring: %m", value, key);
else
return log_error_errno(r, "Couldn't write '%s' to '%s': %m", value, key);
}