Comment 8 for bug 295876

Revision history for this message
PabloAB (pabloab777) wrote :

The reason is in kernel TASK_COMM_LEN (check man proc) constant fixed to 16 (name + \0). A guy called [Luben Tuikov][0] proposed to increase this back on 2006 ([last lines][1] of sys.c). Even if this is too difficult because of mysterous complicated reasons pgrep should search on the complete name, not the truncated version (/proc/PID/comm, /proc/PID/status | grep ^Name).

Maybe something like grep -hoa "\/[^/]*$" /proc/*/cmdline | grep -a pattern [or][2] ps aux | grep "[p]attern".

With -f "the full command line is used" (/proc/PID/cmdline, readlink /proc/PID/exe). This is too broad.

Something similar happen with the 4096 B limit of PAGE_SIZE. In that case the solution is easy, [just recompile the kernel][3] with a new value... :s

[0](http://lkml.iu.edu/hypermail/linux/kernel/0606.2/3139.html)
[1](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/sys.c#n2544)
[2](https://unix.stackexchange.com/a/74186/209677)
[3](https://stackoverflow.com/a/199199/4970442)