diff --git a/src/basic/process-util.c b/src/basic/process-util.c index 0213f5913f..e7b80b31fa 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -368,6 +368,10 @@ int rename_process(const char name[]) { strncpy(program_invocation_name, name, k); if (l > k) truncated = true; + + /* Also update the short name. */ + char *p = strrchr(program_invocation_name, '/'); + program_invocation_short_name = p ? p + 1 : program_invocation_name; } /* Third step, completely replace the argv[] array the kernel maintains for us. This requires privileges, but