fix(sys-apps/systemd): Add patch for daemon-reload bug.

This should fix our issue with hung jobs. Patch from here:
http://lists.freedesktop.org/archives/systemd-devel/2014-April/018361.html

Bug report: https://bugs.freedesktop.org/show_bug.cgi?id=77066
This commit is contained in:
Michael Marineau 2014-04-25 10:48:13 -07:00
parent 77a247366c
commit 89878edf95
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,32 @@
From 7b6a4f0380c0f95e0ce1beccddd82b6c4aecc8bc Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Tue, 1 Apr 2014 18:45:54 +0200
Subject: [PATCH] unit: add waiting jobs to run queue in unit_coldplug
When we have job installed and added to run queue for service which is still in
dead state and systemd initiates reload then after reload we never add
deserialized job to the run queue again. This is caused by check in
service_coldplug() where we check if deserialized state is something else
than dead state, which is not the case thus we never call service_set_state()
and finally unit_notify() where we would have added job to the run queue.
---
src/core/unit.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/core/unit.c b/src/core/unit.c
index 153b79b..bb7893b 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2558,6 +2558,9 @@ int unit_coldplug(Unit *u) {
r = job_coldplug(u->job);
if (r < 0)
return r;
+
+ if (u->job->state == JOB_WAITING)
+ job_add_to_run_queue(u->job);
} else if (u->deserialized_job >= 0) {
/* legacy */
r = manager_add_job(u->manager, u->deserialized_job, u, JOB_IGNORE_REQUIREMENTS, false, NULL, NULL);
--
1.8.3.2

View File

@ -116,6 +116,9 @@ fi
# fix networkd crash, https://bugs.gentoo.org/show_bug.cgi?id=507044
epatch "${FILESDIR}"/212-0001-sd-rtnl-fix-off-by-one.patch
# fix stuck jobs after daemon-reload
epatch "${FILESDIR}"/212-0002-unit-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch
# CoreOs specific hacks^Wfeatures
epatch "${FILESDIR}"/211-handle-empty-etc-os-release.patch