machined: add UnregisterMachine method
This is the opposite of RegisterMachine: machined knows that the machine is "gone", but doesn't do anything on its own. We already had TerminateMachine, but that would stop the unit, which isn't always wanted.
This commit is contained in:
@@ -449,13 +449,16 @@ int machine_stop(Machine *m) {
|
||||
int machine_finalize(Machine *m) {
|
||||
assert(m);
|
||||
|
||||
if (m->started)
|
||||
if (m->started) {
|
||||
log_struct(LOG_INFO,
|
||||
"MESSAGE_ID=" SD_MESSAGE_MACHINE_STOP_STR,
|
||||
"NAME=%s", m->name,
|
||||
"LEADER="PID_FMT, m->leader,
|
||||
LOG_MESSAGE("Machine %s terminated.", m->name));
|
||||
|
||||
m->stopping = true; /* The machine is supposed to be going away. Don't try to kill it. */
|
||||
}
|
||||
|
||||
machine_unlink(m);
|
||||
machine_add_to_gc_queue(m);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user