Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a process whose command line is longer than 4096 characters. When I tried ps wwwp <pid>, I see the command line is truncated at 4096 characters. cat /proc/<pid>/cmdline gave me the same result. Is there a way for me to see the entire command line? I assume 4096 is a default value which I can set somewhere.
Here is my system:
Linux dev1-28 2.6.18-92.1.13.el5.028stab059.6 #1 SMP Fri Nov 14 16:01:01 MSK 2008 x86_64 x86_64 x86_64 GNU/Linux
But... I don't think I've ever had a command + options exceeding 4096 bytes.
If that is not working out, you might review the "-o format" option in the ps(1) manpages. Perhaps a bit of tinkering and you'll get it to display. (Either that or there's a hardcoded limitation in place; I'm not sure.)
Is there a way for me to see the entire command line? I assume 4096 is a default value which I can set somewhere.
You might try (as root):
Code:
sysctl -a | grep 4096
and see if anything interesting turns up. I just tried that and didn't see anything that looked like it might apply to your concern. (But I did see three errors I didn't understand. ) Or ... it could be something that is compiled into the kernel that can't be changed at run time. As a last ditch effort (that is unlikely to succeed) you might take a look at parameters you can supply to the kernel at boot time.
Realize that I am just making wild guesses here. This is *way* above my pay grade!
First of all, thanks for all the replies. And wow, I did not expect this to be a hard problem. I thought it was something well known, even expecting some RTFMs. Anyway, glad we are going to learn something new. Here are some additional information:
* I did try to pipe the output to a file, like ps wwwp pid > file. That did not help.
* I did try cat /proc/pid/cmdline, that gave me the same output as ps did. I mentioned this in my original post.
* Following suggestion from blackhole54, I did sysctl -a | grep 4096, and got
net.ipv4.udp_wmem_min = 4096
net.ipv4.udp_rmem_min = 4096
net.ipv4.tcp_dma_copybreak = 4096
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
kernel.pty.max = 4096
kernel.random.poolsize = 4096
kernel.shmmni = 4096
I don't think any of these are related to the problem.
* I don't have any boot time kernel parameters specified. My grub file says
kernel /vmlinuz-2.6.18-92.1.13.el5.028stab059.6 ro root=/dev/VolGroup00/LogVol00
BTW is there a way I can query the boot parameter used while the system is running?
Anyhow, I suspect this is compiled into the kernel. Just out of curiosity, I wonder if other people are also seeing this. I wrote a simple shell script that will run a command longer than 4096 chars. Can some of you try it on your computer and let me know if you see the same problem? Here is how to do it
1 save the following shell script and run it
#!/bin/sh
# build a string of 5000 chars
long_arg=''
for i in $(seq 1 500)
do
long_arg=${long_arg}0123456789
done
# issue a blocking command with the long arg
exec awk "/$long_arg/{print}"
2 the awk command should block. In a separate terminal, do ps auxwww | grep awk. Do you see the command truncated?
That is rather discouraged around here. Although I have, very politely, in a effect told a few people that. After telling them where the FM was and how to use it.
Quote:
BTW is there a way I can query the boot parameter used while the system is running?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.