Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand it displays the command with arguments, or when unavailable the command in square brackets.

But where do the names come from for processes such as passenger worker ruby instances, which show up as:

root@XXX:~# ps aux | grep Rails
webuser    2273  0.0  3.2  86968 57500 ?        S    17:38   0:00 Rails: /var/websites/app

...and how can I launch processes and set such a string?

share|improve this question
up vote 3 down vote accepted

I believe it is done via the setproctitle function.

 #include <sys/types.h>
 #include <unistd.h>
 setproctitle(const char *fmt, ...);

 The setproctitle() library routine sets the process title that appears on
 the ps(1) command.

For Ruby specifically, there is a stackoverflow post about doing this without third party libraries.

share|improve this answer

Usually you need to change argv directly, here's an example:

share|improve this answer
Thanks a lot for the answer – jberryman Jun 3 '11 at 19:03

Your Answer


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.