* UNIT_STUB if no configuration could be found. */
int (*load)(Unit *u);
- /* If a lot of units got created via enumerate(), this is
- * where to actually set the state and call unit_notify(). */
+ /* During deserialization we only record the intended state to return to. With coldplug() we actually put the
+ * deserialized state in effect. This is where unit_notify() should be called to start things up. */
int (*coldplug)(Unit *u);
+ /* This is called shortly after all units' coldplug() call was invoked. It's supposed to catch up state changes
+ * we missed so far (for example because they took place while we were reloading/reexecing) */
+ void (*catchup)(Unit *u);
+
void (*dump)(Unit *u, FILE *f, const char *prefix);
int (*start)(Unit *u);
/* Returns true if the unit currently needs access to the console */
bool (*needs_console)(Unit *u);
- /* This is called for each unit type and should be used to
- * enumerate existing devices and load them. However,
- * everything that is loaded here should still stay in
- * inactive state. It is the job of the coldplug() call above
- * to put the units into the initial state. */
+ /* This is called for each unit type and should be used to enumerate units already existing in the system
+ * internally and load them. However, everything that is loaded here should still stay in inactive state. It is
+ * the job of the coldplug() call above to put the units into the initial state. */
void (*enumerate)(Manager *m);
/* Type specific cleanups. */
int unit_add_node_dependency(Unit *u, const char *what, bool wants, UnitDependency d, UnitDependencyMask mask);
int unit_coldplug(Unit *u);
+void unit_catchup(Unit *u);
void unit_status_printf(Unit *u, const char *status, const char *unit_status_msg_format) _printf_(3, 0);
void unit_status_emit_starting_stopping_reloading(Unit *u, JobType t);