]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevd: improve logging in SIGCHLD handling
authorTom Gundersen <teg@jklm.no>
Fri, 24 Apr 2015 15:50:49 +0000 (17:50 +0200)
committerTom Gundersen <teg@jklm.no>
Fri, 24 Apr 2015 17:13:48 +0000 (19:13 +0200)
Remove some redundant logging, and reduce the log-level in most cases. The only
case that is really critical is if a worker failed while hanlding an event, so
keep that at error level.

src/udev/udevd.c

index 2d0ac6d61d95b14b1894b67b180690c56f9b858e..60e1ee6f9e5c0ec1ffd550e8ae8058543d07d4d9 100644 (file)
@@ -869,21 +869,21 @@ static void handle_signal(struct udev *udev, int signo) {
 
                                 if (worker->pid != pid)
                                         continue;
-                                log_debug("worker ["PID_FMT"] exit", pid);
 
                                 if (WIFEXITED(status)) {
-                                        if (WEXITSTATUS(status) != 0)
-                                                log_error("worker ["PID_FMT"] exit with return code %i",
-                                                          pid, WEXITSTATUS(status));
+                                        if (WEXITSTATUS(status) == 0)
+                                                log_debug("worker ["PID_FMT"] exited", pid);
+                                        else
+                                                log_warning("worker ["PID_FMT"] exited with return code %i", pid, WEXITSTATUS(status));
                                 } else if (WIFSIGNALED(status)) {
-                                        log_error("worker ["PID_FMT"] terminated by signal %i (%s)",
-                                                  pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
+                                        log_warning("worker ["PID_FMT"] terminated by signal %i (%s)",
+                                                    pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
                                 } else if (WIFSTOPPED(status)) {
-                                        log_error("worker ["PID_FMT"] stopped", pid);
+                                        log_info("worker ["PID_FMT"] stopped", pid);
                                 } else if (WIFCONTINUED(status)) {
-                                        log_error("worker ["PID_FMT"] continued", pid);
+                                        log_info("worker ["PID_FMT"] continued", pid);
                                 } else {
-                                        log_error("worker ["PID_FMT"] exit with status 0x%04x", pid, status);
+                                        log_warning("worker ["PID_FMT"] exit with status 0x%04x", pid, status);
                                 }
 
                                 if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {