]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machined: add a bit more debug logging
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Jul 2025 07:35:25 +0000 (09:35 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 11 Jul 2025 16:15:12 +0000 (18:15 +0200)
src/machine/machine.c
src/machine/machined-core.c

index 26252ff9cdde57624c87ce84e093f40e9809d1fd..e127ddcb0e9b08757cce466fae01fe1bdbf3d9ee 100644 (file)
@@ -33,6 +33,7 @@
 #include "path-util.h"
 #include "process-util.h"
 #include "serialize.h"
+#include "signal-util.h"
 #include "socket-util.h"
 #include "special.h"
 #include "stdio-util.h"
@@ -680,6 +681,8 @@ int machine_stop(Machine *m) {
 
         assert(m);
 
+        log_debug("Stopping machine '%s'.", m->name);
+
         if (!IN_SET(m->class, MACHINE_CONTAINER, MACHINE_VM))
                 return -EOPNOTSUPP;
 
@@ -813,6 +816,8 @@ MachineState machine_get_state(Machine *s) {
 int machine_kill(Machine *m, KillWhom whom, int signo) {
         assert(m);
 
+        log_debug("Killing machine '%s' (%s) with signal %s.", m->name, kill_whom_to_string(whom), signal_to_string(signo));
+
         if (!IN_SET(m->class, MACHINE_VM, MACHINE_CONTAINER))
                 return -EOPNOTSUPP;
 
index 075ea4a80317b20ebf54614e4a8452a6ff1384e3..61078d51ec3e1264c6461a0e55c42ae43e66f965 100644 (file)
@@ -162,13 +162,16 @@ void manager_gc(Manager *m, bool drop_not_started) {
 
                 /* First, if we are not closing yet, initiate stopping */
                 if (machine_may_gc(machine, drop_not_started) &&
-                    machine_get_state(machine) != MACHINE_CLOSING)
+                    machine_get_state(machine) != MACHINE_CLOSING) {
+                        log_debug("Stopping machine '%s' due to GC.", machine->name);
                         machine_stop(machine);
+                }
 
                 /* Now, the stop probably made this referenced
                  * again, but if it didn't, then it's time to let it
                  * go entirely. */
                 if (machine_may_gc(machine, drop_not_started)) {
+                        log_debug("Finalizing machine '%s' due to GC.", machine->name);
                         machine_finalize(machine);
                         machine_free(machine);
                 }