if (UNIT_IS_LOAD_ERROR(u->load_state)) {
/* The unit was previously not found or otherwise not loaded. Now that the unit shows up in
- * /proc/self/mountinfo we should reconsider it this, hence set it to UNIT_LOADED. */
- u->load_state = UNIT_LOADED;
+ * /proc/self/mountinfo we should reconsider that. Hence, let's reset the load state and load
+ * error, and add the unit to load queue. */
+ u->load_state = UNIT_STUB;
u->load_error = 0;
+ unit_add_to_load_queue(u);
flags |= MOUNT_PROC_JUST_CHANGED;
}
s->what = strdup(what);
if (!s->what)
return log_oom();
-
- unit_add_to_load_queue(u);
}
SwapParameters *p = &s->parameters_proc_swaps;
return log_oom();
}
- /* The unit is definitely around now, mark it as loaded if it was previously referenced but
- * could not be loaded. After all we can load it now, from the data in /proc/swaps. */
+ /* The unit is definitely around now. When we previously fail to load the unit, let's reload the unit
+ * by resetting the load state and load error, and adding the unit to the load queue. */
if (UNIT_IS_LOAD_ERROR(u->load_state)) {
- u->load_state = UNIT_LOADED;
+ u->load_state = UNIT_STUB;
u->load_error = 0;
}
+ unit_add_to_load_queue(u);
+
if (set_flags) {
s->is_active = true;
s->just_activated = !s->from_proc_swaps;