diff --git a/NEWS b/NEWS index c044e61c..d04b42e1 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ procps-ng-NEXT * ps: display control group name with -o cgname * ps: Fallback to attr/current for context Debian #786956 * tests: Conditionally add prctl Debian #816237 + * pidof: check cmd if space in argv0. GitLab #4 procps-ng-3.3.11 ---------------- diff --git a/pidof.c b/pidof.c index 8712d113..01f0c0a1 100644 --- a/pidof.c +++ b/pidof.c @@ -210,6 +210,12 @@ static void select_procs (void) match = 1; } } + /* If there is a space in arg0 then process probably has + * setproctitle so use the cmdline + */ + if (!match && strchr(cmd_arg0, ' ')) { + match = (strcmp(program, task.cmd)==0); + } safe_free(exe_link);