Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running into an issue where some of my Ubuntu/Debian servers do not show the arguments passed to rake in either top or ps. I have tracked this problem down to a variation in output given by /proc/[pid]/cmdline. This is the file that seems to control what is shown by ps and top. On the servers that correctly show the arguments, the contents of the cmdline file are akin to:

ruby^@/home/user/.rvm/gems/ree-1.8.7-2011.03/bin/rake^@log_file_tailer:run^@

However, on the servers that don't show rake arguments, the output of cmdline looks like

/home/user/.rvm/gems/ree-1.8.7-2011.03/bin/rake^@                                                                                                        ^@^@^@^@^@

That is, the contents of the file are two lines long, but don't contain any information about the arguments passed to rake.

FWIW, the two servers I have that output the cmdline in the less useful format (the one lacking arguments) are running

Linux version 2.6.32-5-amd64 (Debian 2.6.32-46) (dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Sun Sep 23 10:07:46 UTC 2012

and

Linux version 3.2.0-23-generic (buildd@crested) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu4) ) #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012

Interestingly, these servers do seem to correctly show the full command line, including arguments, for most commands that I see excluding rake.

Does anyone know how I can get the full command line, including arguments, to be output to cmdline on these servers? I am greatly hoping this won't require an entire recompilation of the kernel (which I have precious little experience with).

-- EDIT -- It's been speculated that it is soley rake that is responsible for setting the contents of /proc/[pid]/cmdline, but that doesn't jibe with the fact that we're running the same version of rake (0.8.7) on the servers that do and don't give us the command line parameters invoked by rake.

share|improve this question

1 Answer 1

The short answer is: you can't.

Only the process itself has any influence on the contents of /proc/$pid/cmdline. Some tools (ab)use this to override what top and ps display. So either those rake instances have done this, or they simply don't have any arguments to begin with.

If rake uses this trick, and you don't want it to, maybe the rake documentation will tell you how to disable this behaviour.

share|improve this answer
    
What doesn't make sense about this is that we're running the same version of rake (0.8.7) on the servers that output the rake arguments and the servers that don't. It seems the only difference between the ones that do and don't show arguments is the OS? –  wbharding Apr 18 '13 at 17:55
    
Debian is upstream of Ubuntu, certainly, but the Ubuntu team is equally known for putting its own patches in. It is very possible that you could have different builds of rake, even with the same package version. –  Scrivener Apr 19 '13 at 1:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.