anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0231-unit-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch

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