[systemd-commits] 3 commits - src/udev
Tom Gundersen
tomegun at kemper.freedesktop.org
Fri Apr 24 10:13:56 PDT 2015
src/udev/udevd.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
New commits:
commit e2f8d97a1316af5b2d5c1f69d12e33709e830a1b
Author: Tom Gundersen <teg at jklm.no>
Date: Fri Apr 24 18:35:58 2015 +0200
udevd: don't unref worker objects on SIGSTOP/SIGCONT
We should not be receiving these anyway, but let's be correct.
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 6b5d99b..a84b407 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -883,8 +883,10 @@ static void handle_signal(struct udev *udev, int signo) {
pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
} else if (WIFSTOPPED(status)) {
log_info("worker ["PID_FMT"] stopped", pid);
+ break;
} else if (WIFCONTINUED(status)) {
log_info("worker ["PID_FMT"] continued", pid);
+ break;
} else {
log_warning("worker ["PID_FMT"] exit with status 0x%04x", pid, status);
}
commit d1317d02e637e19e9f40175657ff8e6098523633
Author: Tom Gundersen <teg at jklm.no>
Date: Fri Apr 24 18:04:57 2015 +0200
udevd: warn if we receive SIGCHLD from untracked worker
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 60e1ee6..6b5d99b 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -859,6 +859,7 @@ static void handle_signal(struct udev *udev, int signo) {
pid_t pid;
int status;
struct udev_list_node *loop, *tmp;
+ bool found = false;
pid = waitpid(-1, &status, WNOHANG);
if (pid <= 0)
@@ -869,6 +870,8 @@ static void handle_signal(struct udev *udev, int signo) {
if (worker->pid != pid)
continue;
+ else
+ found = true;
if (WIFEXITED(status)) {
if (WEXITSTATUS(status) == 0)
@@ -905,6 +908,9 @@ static void handle_signal(struct udev *udev, int signo) {
worker_unref(worker);
break;
}
+
+ if (!found)
+ log_warning("worker ["PID_FMT"] is unknown, ignoring", pid);
}
break;
case SIGHUP:
commit 70a93737ecd613d9b5855cb5d7c80829b966ec6a
Author: Tom Gundersen <teg at jklm.no>
Date: Fri Apr 24 17:50:49 2015 +0200
udevd: improve logging in SIGCHLD handling
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.
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 2d0ac6d..60e1ee6 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -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) {
More information about the systemd-commits
mailing list