summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-11-14 21:57:10 +0100
committerLennart Poettering <lennart@poettering.net>2010-11-14 23:48:20 +0100
commit57339f47f17b0268f2d05b5e8adde1b1d842fa48 (patch)
treefdfca181ab014b51bf8229e964ae7fba802667fb
parent761163046260b42c0bed075c17d43e0e6c3dd3a4 (diff)
job: make it possible to wait for devices to be unplugged
-rw-r--r--TODO2
-rw-r--r--src/job.c8
-rw-r--r--src/unit.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/TODO b/TODO
index ca39210f10..d02dbd78e6 100644
--- a/TODO
+++ b/TODO
@@ -86,7 +86,7 @@ Pre v12:
* fix hotplug transactions
-* make it possible to wait for device unplug, i.e. issue "stop" on devices
+* plymouth agent start loop
External:
diff --git a/src/job.c b/src/job.c
index 8ab12cd624..79189f04da 100644
--- a/src/job.c
+++ b/src/job.c
@@ -385,6 +385,9 @@ int job_run_and_invalidate(Job *j) {
case JOB_START:
r = unit_start(j->unit);
+
+ /* If this unit cannot be started, then simply
+ * wait */
if (r == -EBADR)
r = 0;
break;
@@ -402,6 +405,11 @@ int job_run_and_invalidate(Job *j) {
case JOB_STOP:
r = unit_stop(j->unit);
+
+ /* If this unit cannot stopped, then simply
+ * wait. */
+ if (r == -EBADR)
+ r = 0;
break;
case JOB_RELOAD:
diff --git a/src/unit.c b/src/unit.c
index 410ff9f607..a619727f96 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -1386,9 +1386,9 @@ bool unit_job_is_applicable(Unit *u, JobType j) {
case JOB_VERIFY_ACTIVE:
case JOB_START:
+ case JOB_STOP:
return true;
- case JOB_STOP:
case JOB_RESTART:
case JOB_TRY_RESTART:
return unit_can_start(u);