From 75e05a988011f5d4358f1f30b9b7d47cfaf0b78a Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Thu, 30 Oct 2025 16:01:17 +0100 Subject: [PATCH] core/exec-invoke: rename process earlier This is independent of any other setup stages, and should happen as early as possible to make comm logged by journald accurate. --- src/core/exec-invoke.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c index cb778359fc1..c5d88dfd826 100644 --- a/src/core/exec-invoke.c +++ b/src/core/exec-invoke.c @@ -5053,6 +5053,8 @@ int exec_invoke( return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid command line arguments."); } + rename_process_from_path(command->path); + if (context->std_input == EXEC_INPUT_SOCKET || context->std_output == EXEC_OUTPUT_SOCKET || context->std_error == EXEC_OUTPUT_SOCKET) { @@ -5078,8 +5080,6 @@ int exec_invoke( return log_error_errno(r, "Failed to load a named file descriptor: %m"); } - rename_process_from_path(command->path); - /* We reset exactly these signals, since they are the only ones we set to SIG_IGN in the main * daemon. All others we leave untouched because we set them to SIG_DFL or a valid handler initially, * both of which will be demoted to SIG_DFL. */ -- 2.47.3