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>
Fri, 19 Nov 2021 20:11:45 +0000 (20:11 +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 399a759ad034fe5a3376b468a62b30af00130a53..132ad88ac34db644d20969ad47964737beada590 100644 (file)
@@ -371,6 +371,7 @@ static int patch_var_run(
 
         const char *e;
         char *z;
+        int log_level;
 
         e = path_startswith(*path, "/var/run/");
         if (!e)
@@ -380,7 +381,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 bf23c48662162708a31017e077c1195513b7e774..7aa406ce9e6e142c9b07d5868e998f14169777cb 100644 (file)
@@ -763,7 +763,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 7e85c506348a153b3a449109f0c6b3feb2b56a6e..e94959b1c67f7bb077dd336a8751d80334280ade 100644 (file)
@@ -2821,6 +2821,7 @@ static int specifier_expansion_from_arg(Item *i) {
 static int patch_var_run(const char *fname, unsigned line, char **path) {
         const char *k;
         char *n;
+        int log_level;
 
         assert(path);
         assert(*path);
@@ -2846,7 +2847,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);