From d9b91fa93ba7bd4e37b684fc9f229e0b726e6a0a Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones Date: May 28 2015 08:02:50 +0000 Subject: Add patch to fix udev --daemon not cleaning child processes (upstream commit 86c3bece38bcf5). --- diff --git a/0001-udevd-fix-SIGCHLD-handling-in-daemon-mode.patch b/0001-udevd-fix-SIGCHLD-handling-in-daemon-mode.patch new file mode 100644 index 0000000..88e4a1e --- /dev/null +++ b/0001-udevd-fix-SIGCHLD-handling-in-daemon-mode.patch @@ -0,0 +1,78 @@ +From 86c3bece38bcf55da6387d20c6f01da9ad0284dc Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Wed, 27 May 2015 18:39:36 +0200 +Subject: [PATCH] udevd: fix SIGCHLD handling in --daemon mode + +We were listening for SIGCHLD in the wrong process. +--- + src/udev/udevd.c | 33 ++++++++++++++++++++++----------- + 1 file changed, 22 insertions(+), 11 deletions(-) + +diff --git a/src/udev/udevd.c b/src/udev/udevd.c +index 87e677e..299fda8 100644 +--- a/src/udev/udevd.c ++++ b/src/udev/udevd.c +@@ -1288,13 +1288,6 @@ static int parse_argv(int argc, char *argv[]) { + + static int manager_new(Manager **ret) { + _cleanup_(manager_freep) Manager *manager = NULL; +- struct epoll_event ep_ctrl = { .events = EPOLLIN }; +- struct epoll_event ep_inotify = { .events = EPOLLIN }; +- struct epoll_event ep_signal = { .events = EPOLLIN }; +- struct epoll_event ep_netlink = { .events = EPOLLIN }; +- struct epoll_event ep_worker = { .events = EPOLLIN }; +- sigset_t mask; +- int r, one = 1; + + assert(ret); + +@@ -1323,6 +1316,23 @@ static int manager_new(Manager **ret) { + udev_list_node_init(&manager->events); + udev_list_init(manager->udev, &manager->properties, true); + ++ *ret = manager; ++ manager = NULL; ++ ++ return 0; ++} ++ ++static int manager_listen(Manager *manager) { ++ struct epoll_event ep_ctrl = { .events = EPOLLIN }; ++ struct epoll_event ep_inotify = { .events = EPOLLIN }; ++ struct epoll_event ep_signal = { .events = EPOLLIN }; ++ struct epoll_event ep_netlink = { .events = EPOLLIN }; ++ struct epoll_event ep_worker = { .events = EPOLLIN }; ++ sigset_t mask; ++ int r, one = 1; ++ ++ assert(manager); ++ + r = systemd_fds(&manager->fd_ctrl, &manager->fd_uevent); + if (r >= 0) { + /* get control and netlink socket from systemd */ +@@ -1404,10 +1414,7 @@ static int manager_new(Manager **ret) { + epoll_ctl(manager->fd_ep, EPOLL_CTL_ADD, manager->fd_worker, &ep_worker) < 0) + return log_error_errno(errno, "fail to add fds to epoll: %m"); + +- *ret = manager; +- manager = NULL; +- +- return 1; ++ return 0; + } + + int main(int argc, char *argv[]) { +@@ -1518,6 +1525,10 @@ int main(int argc, char *argv[]) { + } else + sd_notify(1, "READY=1"); + ++ r = manager_listen(manager); ++ if (r < 0) ++ return log_error_errno(r, "failed to set up fds and listen for events: %m"); ++ + for (;;) { + static usec_t last_usec; + struct epoll_event ev[8]; +-- +2.3.1 + diff --git a/systemd.spec b/systemd.spec index b857178..4c9bb28 100644 --- a/systemd.spec +++ b/systemd.spec @@ -16,7 +16,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 220 -Release: 2%{?gitcommit:.git%{gitcommit}}%{?dist} +Release: 3%{?gitcommit:.git%{gitcommit}}%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -47,6 +47,12 @@ Patch1000: kernel-install-grubby.patch # This is upstream commit 040e689654ef08. Patch1001: 0001-udevd-event-fix-event-queue-in-daemenozied-mode.patch +# Fix udev --daemon not cleaning child processes: +# https://www.mail-archive.com/systemd-devel@lists.freedesktop.org/msg31806.html +# https://bugzilla.redhat.com/show_bug.cgi?id=1225641 +# This is upstream commit 86c3bece38bcf5. +Patch1002: 0001-udevd-fix-SIGCHLD-handling-in-daemon-mode.patch + %global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);} BuildRequires: libcap-devel @@ -845,6 +851,10 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd /usr/lib/firewalld/services/* %changelog +* Thu May 28 2015 Richard W.M. Jones - 220-3 +- Add patch to fix udev --daemon not cleaning child processes + (upstream commit 86c3bece38bcf5). + * Wed May 27 2015 Richard W.M. Jones - 220-2 - Add patch to fix udev --daemon crash (upstream commit 040e689654ef08).