51ba67c
From 457d8b69d5365eb20d39391e2590304a923e9bd5 Mon Sep 17 00:00:00 2001
51ba67c
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
51ba67c
Date: Thu, 16 Oct 2014 19:13:45 -0500
51ba67c
Subject: [PATCH] systemd: log deserialization errors as warnings
51ba67c
51ba67c
If we failed to parse something that we wrote ourselves,
51ba67c
things are seriously off. This is also likely to lead to
51ba67c
problems futher on.
51ba67c
---
51ba67c
 src/core/manager.c | 16 ++++++++--------
51ba67c
 1 file changed, 8 insertions(+), 8 deletions(-)
51ba67c
51ba67c
diff --git a/src/core/manager.c b/src/core/manager.c
51ba67c
index e0c1cd187e..1bf75e20b0 100644
51ba67c
--- a/src/core/manager.c
51ba67c
+++ b/src/core/manager.c
51ba67c
@@ -354,7 +354,7 @@ static int manager_setup_signals(Manager *m) {
51ba67c
                 return r;
51ba67c
 
51ba67c
         /* Process signals a bit earlier than the rest of things, but
51ba67c
-         * later that notify_fd processing, so that the notify
51ba67c
+         * later than notify_fd processing, so that the notify
51ba67c
          * processing can still figure out to which process/service a
51ba67c
          * message belongs, before we reap the process. */
51ba67c
         r = sd_event_source_set_priority(m->signal_event_source, -5);
51ba67c
@@ -2229,7 +2229,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
51ba67c
                         uint32_t id;
51ba67c
 
51ba67c
                         if (safe_atou32(l+15, &id) < 0)
51ba67c
-                                log_debug("Failed to parse current job id value %s", l+15);
51ba67c
+                                log_warning("Failed to parse current job id value %s", l+15);
51ba67c
                         else
51ba67c
                                 m->current_job_id = MAX(m->current_job_id, id);
51ba67c
 
51ba67c
@@ -2237,7 +2237,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
51ba67c
                         uint32_t n;
51ba67c
 
51ba67c
                         if (safe_atou32(l+17, &n) < 0)
51ba67c
-                                log_debug("Failed to parse installed jobs counter %s", l+17);
51ba67c
+                                log_warning("Failed to parse installed jobs counter %s", l+17);
51ba67c
                         else
51ba67c
                                 m->n_installed_jobs += n;
51ba67c
 
51ba67c
@@ -2245,7 +2245,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
51ba67c
                         uint32_t n;
51ba67c
 
51ba67c
                         if (safe_atou32(l+14, &n) < 0)
51ba67c
-                                log_debug("Failed to parse failed jobs counter %s", l+14);
51ba67c
+                                log_warning("Failed to parse failed jobs counter %s", l+14);
51ba67c
                         else
51ba67c
                                 m->n_failed_jobs += n;
51ba67c
 
51ba67c
@@ -2254,7 +2254,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
51ba67c
 
51ba67c
                         b = parse_boolean(l+10);
51ba67c
                         if (b < 0)
51ba67c
-                                log_debug("Failed to parse taint /usr flag %s", l+10);
51ba67c
+                                log_warning("Failed to parse taint /usr flag %s", l+10);
51ba67c
                         else
51ba67c
                                 m->taint_usr = m->taint_usr || b;
51ba67c
 
51ba67c
@@ -2305,7 +2305,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
51ba67c
                         int fd;
51ba67c
 
51ba67c
                         if (safe_atoi(l + 10, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
51ba67c
-                                log_debug("Failed to parse notify fd: %s", l + 10);
51ba67c
+                                log_warning("Failed to parse notify fd: %s", l + 10);
51ba67c
                         else {
51ba67c
                                 m->notify_event_source = sd_event_source_unref(m->notify_event_source);
51ba67c
                                 safe_close(m->notify_fd);
51ba67c
@@ -2328,14 +2328,14 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
51ba67c
                         int fd;
51ba67c
 
51ba67c
                         if (safe_atoi(l + 9, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
51ba67c
-                                log_debug("Failed to parse kdbus fd: %s", l + 9);
51ba67c
+                                log_warning("Failed to parse kdbus fd: %s", l + 9);
51ba67c
                         else {
51ba67c
                                 safe_close(m->kdbus_fd);
51ba67c
                                 m->kdbus_fd = fdset_remove(fds, fd);
51ba67c
                         }
51ba67c
 
51ba67c
                 } else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) == 0)
51ba67c
-                        log_debug("Unknown serialization item '%s'", l);
51ba67c
+                        log_warning("Unknown serialization item '%s'", l);
51ba67c
         }
51ba67c
 
51ba67c
         for (;;) {