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.
This commit is contained in:
Mike Yuan
2025-10-30 17:45:34 +01:00
parent edb8fcd813
commit 75e05a9880
+2 -2
View File
@@ -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. */