chiark / gitweb /
job: make it possible to wait for devices to be unplugged
authorLennart Poettering <lennart@poettering.net>
Sun, 14 Nov 2010 20:57:10 +0000 (21:57 +0100)
committerLennart Poettering <lennart@poettering.net>
Sun, 14 Nov 2010 22:48:20 +0000 (23:48 +0100)
TODO
src/job.c
src/unit.c

diff --git a/TODO b/TODO
index ca39210f10bd65fbd2bfe543c44061ee9629354f..d02dbd78e6cbf7c70e9873714a9a69da536b0fa5 100644 (file)
--- 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:
 
index 8ab12cd62410eb3287e4a6c052915108b79fa604..79189f04da101db1ed8188ea95601c6e1c64f8cd 100644 (file)
--- 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:
index 410ff9f6071c8faca98a0219fbb5a991d0eba58e..a619727f9640b225e0723774cc01b547cadbfd70 100644 (file)
@@ -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);