Downgrade a couple of warnings to debug
authorMichael Biebl <biebl@debian.org>
Mon, 15 Feb 2021 23:18:50 +0000 (00:18 +0100)
committerRaspbian forward porter <root@raspbian.org>
Tue, 9 Aug 2022 18:16:48 +0000 (19:16 +0100)
If a package still ships only a SysV init script or if a service file or
tmpfile uses /var/run, downgrade those messages to debug. We can use
lintian to detect those issues.
For service files and tmpfiles in /etc, keep the warning, as those files
are typically added locally and aren't checked by lintian.

Closes: #981407
Gbp-Pq: Topic debian
Gbp-Pq: Name Downgrade-a-couple-of-warnings-to-debug.patch

src/core/load-fragment.c
src/sysv-generator/sysv-generator.c
src/tmpfiles/tmpfiles.c

index 11991ecdc0c3a27caf5862a3fdf1a3dc5d4c9537..76893db71469acb37be9ebee7a47dd20d80eb7c1 100644 (file)
@@ -522,6 +522,7 @@ static int patch_var_run(
 
         const char *e;
         char *z;
+        int log_level;
 
         e = path_startswith(*path, "/var/run/");
         if (!e)
@@ -531,7 +532,8 @@ static int patch_var_run(
         if (!z)
                 return log_oom();
 
-        log_syntax(unit, LOG_NOTICE, filename, line, 0,
+        log_level = path_startswith(filename, "/etc") ? LOG_NOTICE : LOG_DEBUG;
+        log_syntax(unit, log_level, filename, line, 0,
                    "%s= references a path below legacy directory /var/run/, updating %s → %s; "
                    "please update the unit file accordingly.", lvalue, *path, z);
 
index 14ae873dc05c8ba167f52a07fd3f5b5481331410..aa9e94bba601a3489ed7e9eea86d0cf735883f16 100644 (file)
@@ -760,7 +760,7 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
                         if (!fpath)
                                 return log_oom();
 
-                        log_warning("SysV service '%s' lacks a native systemd unit file. "
+                        log_debug("SysV service '%s' lacks a native systemd unit file. "
                                     "Automatically generating a unit file for compatibility. "
                                     "Please update package to include a native systemd unit file, in order to make it more safe and robust.", fpath);
 
index d5db0304d5236910d2f835609e948498e7e365ef..919d6d9d5752b7d0f143cdf059b9363c63af4e1a 100644 (file)
@@ -2760,6 +2760,7 @@ static int specifier_expansion_from_arg(const Specifier *specifier_table, Item *
 static int patch_var_run(const char *fname, unsigned line, char **path) {
         const char *k;
         char *n;
+        int log_level;
 
         assert(path);
         assert(*path);
@@ -2785,7 +2786,8 @@ static int patch_var_run(const char *fname, unsigned line, char **path) {
         /* Also log about this briefly. We do so at LOG_NOTICE level, as we fixed up the situation automatically, hence
          * there's no immediate need for action by the user. However, in the interest of making things less confusing
          * to the user, let's still inform the user that these snippets should really be updated. */
-        log_syntax(NULL, LOG_NOTICE, fname, line, 0,
+        log_level = path_startswith(fname, "/etc") ? LOG_NOTICE : LOG_DEBUG;
+        log_syntax(NULL, log_level, fname, line, 0,
                    "Line references path below legacy directory /var/run/, updating %s → %s; please update the tmpfiles.d/ drop-in file accordingly.",
                    *path, n);