summaryrefslogtreecommitdiff
path: root/src/core/job.c
diff options
context:
space:
mode:
authorBrandon Philips <brandon@ifup.co>2014-04-25 09:31:59 -0600
committermsekleta <msekleta@systemd-devel-vm.default>2014-04-26 17:59:14 +0200
commit20a83d7bf4542875f8033b68682a4da4993010e8 (patch)
treeb28b48357931bb9e0d29cb8e3e48397778e87612 /src/core/job.c
parentae0ceefc2f432bc1068889fcff53d929eca8a3c4 (diff)
job: 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. Thanks to Michal Sekletar <msekleta@redhat.com> for the original patch.
Diffstat (limited to 'src/core/job.c')
-rw-r--r--src/core/job.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/job.c b/src/core/job.c
index 35a9de6ee3..835cfe173b 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -1066,6 +1066,9 @@ int job_coldplug(Job *j) {
if (j->timer_event_source)
j->timer_event_source = sd_event_source_unref(j->timer_event_source);
+ if (j->state == JOB_WAITING)
+ job_add_to_run_queue(j);
+
r = sd_event_add_time(
j->manager->event,
&j->timer_event_source,