]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
manager/service: when we spawn, say why
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 1 Mar 2022 10:59:48 +0000 (11:59 +0100)
committerLuca Boccassi <bluca@debian.org>
Thu, 10 Mar 2022 14:51:28 +0000 (14:51 +0000)
We already logged what we are spawning, but not so much why. Let's
add this, so it's easier to distinguish execstartpre/execstart/execstartpost
and such.

src/core/service.c

index b71c26ca330d80e5befc3e74128c4d81725b1b1c..f5fe683cf2f72b199c961e527d9037a08eaa9bb3 100644 (file)
@@ -43,6 +43,8 @@
 #include "utf8.h"
 #include "util.h"
 
+#define service_spawn(...) service_spawn_internal(__func__, __VA_ARGS__)
+
 static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
         [SERVICE_DEAD] = UNIT_INACTIVE,
         [SERVICE_CONDITION] = UNIT_ACTIVATING,
@@ -1480,7 +1482,8 @@ static Service *service_get_triggering_service(Service *s) {
         return SERVICE(candidate);
 }
 
-static int service_spawn(
+static int service_spawn_internal(
+                const char *caller,
                 Service *s,
                 ExecCommand *c,
                 usec_t timeout,
@@ -1500,10 +1503,13 @@ static int service_spawn(
         pid_t pid;
         int r;
 
+        assert(caller);
         assert(s);
         assert(c);
         assert(ret_pid);
 
+        log_unit_debug(UNIT(s), "Will spawn child (%s): %s", caller, c->path);
+
         r = unit_prepare_exec(UNIT(s)); /* This realizes the cgroup, among other things */
         if (r < 0)
                 return r;