Downgrade a couple of warnings to debug
authorMichael Biebl <biebl@debian.org>
Mon, 15 Feb 2021 23:18:50 +0000 (00:18 +0100)
committerMichael Biebl <biebl@debian.org>
Wed, 25 Jan 2023 08:17:24 +0000 (08:17 +0000)
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 1a5895346d96633561d2a624068b91871e193386..4fd29975d48a2099e467e883d7f44d039a4ec3a1 100644 (file)
@@ -543,6 +543,7 @@ static int patch_var_run(
 
         const char *e;
         char *z;
+        int log_level;
 
         e = path_startswith(*path, "/var/run/");
         if (!e)
@@ -552,7 +553,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 3c5df6c3ec86cfec790b1ec2e3569111c17f7019..24eff868f29cb8f277c65d7c1232c4ff2f3cfcec 100644 (file)
@@ -761,7 +761,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 18bb75715b00fe3f86745494195e154b75ce5c6f..1f609134998b6d341a2192a46dfc515a144236aa 100644 (file)
@@ -2987,6 +2987,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);
@@ -3012,7 +3013,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);