From d7921114d72efa68a71f783aeae5fbeb94b03d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 1 Jul 2019 16:15:40 +0200 Subject: [PATCH] udev: warn when we fail to parse udev.conf This should be like any other parse error and a warning should be emitted. Let's use log_syntax() so we get the CONFIG_FILE= set. --- src/shared/udev-util.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/shared/udev-util.c b/src/shared/udev-util.c index 482d914d078..ea96f5b49dc 100644 --- a/src/shared/udev-util.c +++ b/src/shared/udev-util.c @@ -57,25 +57,29 @@ int udev_parse_config_full( * to regulate the code in libudev/ and udev/. */ r = log_set_max_level_from_string_realm(LOG_REALM_UDEV, log); if (r < 0) - log_debug_errno(r, "/etc/udev/udev.conf: failed to set udev log level '%s', ignoring: %m", log); + log_syntax(NULL, LOG_WARNING, "/etc/udev/udev.conf", 0, r, + "failed to set udev log level '%s', ignoring: %m", log); } if (ret_children_max && children_max) { r = safe_atou(children_max, ret_children_max); if (r < 0) - log_notice_errno(r, "/etc/udev/udev.conf: failed to set parse children_max=%s, ignoring: %m", children_max); + log_syntax(NULL, LOG_WARNING, "/etc/udev/udev.conf", 0, r, + "failed to set parse children_max=%s, ignoring: %m", children_max); } if (ret_exec_delay_usec && exec_delay) { r = parse_sec(exec_delay, ret_exec_delay_usec); if (r < 0) - log_notice_errno(r, "/etc/udev/udev.conf: failed to set parse exec_delay=%s, ignoring: %m", exec_delay); + log_syntax(NULL, LOG_WARNING, "/etc/udev/udev.conf", 0, r, + "failed to set parse exec_delay=%s, ignoring: %m", exec_delay); } if (ret_event_timeout_usec && event_timeout) { r = parse_sec(event_timeout, ret_event_timeout_usec); if (r < 0) - log_notice_errno(r, "/etc/udev/udev.conf: failed to set parse event_timeout=%s, ignoring: %m", event_timeout); + log_syntax(NULL, LOG_WARNING, "/etc/udev/udev.conf", 0, r, + "failed to set parse event_timeout=%s, ignoring: %m", event_timeout); } if (ret_resolve_name_timing && resolve_names) { @@ -83,7 +87,8 @@ int udev_parse_config_full( t = resolve_name_timing_from_string(resolve_names); if (t < 0) - log_notice("/etc/udev/udev.conf: failed to set parse resolve_names=%s, ignoring.", resolve_names); + log_syntax(NULL, LOG_WARNING, "/etc/udev/udev.conf", 0, r, + "failed to set parse resolve_names=%s, ignoring.", resolve_names); else *ret_resolve_name_timing = t; }