From 78ba63c3c7a2b19316177d9be297a74db4a1fcd6 Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones Date: May 27 2015 12:57:29 +0000 Subject: Add patch to fix udev --daemon crash (upstream commit 040e689654ef08). --- diff --git a/0001-udevd-event-fix-event-queue-in-daemenozied-mode.patch b/0001-udevd-event-fix-event-queue-in-daemenozied-mode.patch new file mode 100644 index 0000000..7f8a6a0 --- /dev/null +++ b/0001-udevd-event-fix-event-queue-in-daemenozied-mode.patch @@ -0,0 +1,45 @@ +From 040e689654ef08c63ab93bf0875865398e8d9c91 Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Sun, 24 May 2015 15:20:36 +0200 +Subject: [PATCH] udevd: event - fix event queue in daemenozied mode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We would enforce that events could only be added to the queue from the +main process, but that brake in daemonized mode. Relax the restriction +to only allow one process to add events to the queue. + +Reported by Mantas Mikulėnas. +--- + src/udev/udevd.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/udev/udevd.c b/src/udev/udevd.c +index 4a44b03..b33a262 100644 +--- a/src/udev/udevd.c ++++ b/src/udev/udevd.c +@@ -564,7 +564,10 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) { + assert(manager); + assert(dev); + +- /* only the main process can add events to the queue */ ++ /* only one process can add events to the queue */ ++ if (manager->pid == 0) ++ manager->pid = getpid(); ++ + assert(manager->pid == getpid()); + + event = new0(struct event, 1); +@@ -1300,8 +1303,6 @@ static int manager_new(Manager **ret) { + if (!manager) + return log_oom(); + +- manager->pid = getpid(); +- + manager->fd_ep = -1; + manager->fd_ctrl = -1; + manager->fd_uevent = -1; +-- +2.3.1 + diff --git a/systemd.spec b/systemd.spec index ade52a7..b857178 100644 --- a/systemd.spec +++ b/systemd.spec @@ -16,7 +16,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 220 -Release: 1%{?gitcommit:.git%{gitcommit}}%{?dist} +Release: 2%{?gitcommit:.git%{gitcommit}}%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -42,6 +42,11 @@ Source8: systemd-journal-gatewayd.xml # kernel-install patch for grubby, drop if grubby is obsolete Patch1000: kernel-install-grubby.patch +# Fix udev --daemon crash: +# http://comments.gmane.org/gmane.comp.sysutils.systemd.devel/32067 +# This is upstream commit 040e689654ef08. +Patch1001: 0001-udevd-event-fix-event-queue-in-daemenozied-mode.patch + %global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);} BuildRequires: libcap-devel @@ -840,6 +845,9 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd /usr/lib/firewalld/services/* %changelog +* Wed May 27 2015 Richard W.M. Jones - 220-2 +- Add patch to fix udev --daemon crash (upstream commit 040e689654ef08). + * Thu May 21 2015 Lennart Poettering - 220-1 - New upstream release - Drop /etc/mtab hack, as that's apparently fixed in mock now (#1116158)