From: Zbigniew Jędrzejewski-Szmek Date: Tue, 1 Mar 2022 10:59:48 +0000 (+0100) Subject: manager/service: when we spawn, say why X-Git-Tag: v251-rc1~175^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edbf8984a48de047df9f7172d73ee6b232f559f6;p=thirdparty%2Fsystemd.git manager/service: when we spawn, say why 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. --- diff --git a/src/core/service.c b/src/core/service.c index b71c26ca330..f5fe683cf2f 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -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;