From: Harald Hoyer <harald@xxxxxxxxxx> Store pointer of command to RUN in the event, to aid debugging of timed out events. --- udev/udev-event.c | 2 ++ udev/udevd.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/udev/udev-event.c b/udev/udev-event.c index 60d06aa..6ac6ff5 100644 --- a/udev/udev-event.c +++ b/udev/udev-event.c @@ -688,10 +688,12 @@ int udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask) info(event->udev, "delay execution of '%s'\n", program); sleep(event->exec_delay); } + event->program = program; if (util_run_program(event->udev, program, envp, NULL, 0, NULL, sigmask) != 0) { if (udev_list_entry_get_flags(list_entry)) err = -1; } + event->program = NULL; } } return err; diff --git a/udev/udevd.c b/udev/udevd.c index f730cab..47bc2f4 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -106,6 +106,7 @@ struct event { dev_t devnum; bool is_block; int ifindex; + char *program; }; static struct event *node_to_event(struct udev_list_node *node) @@ -807,9 +808,14 @@ static void handle_signal(struct udev *udev, int signo) info(udev, "worker [%u] exit\n", pid); if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { - err(udev, "worker [%u] unexpectedly returned with status 0x%04x\n", pid, status); + if (WIFSIGNALED(status)) + err(udev, "worker [%u] killed by signal %d\n", pid, WTERMSIG(status)); + if (WEXITSTATUS(status)) + err(udev, "worker [%u] unexpectedly returned with status %d\n", pid, WEXITSTATUS(status)); if (worker->event != NULL) { err(udev, "worker [%u] failed while handling '%s'\n", pid, worker->event->devpath); + if (worker->event->program) + err(udev, "worker [%u] failed while running '%s'\n", pid, worker->event->program); worker->event->exitcode = -32; event_queue_delete(worker->event, true); /* drop reference from running event */ -- 1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html