2

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?

2 Answers 2

3

I believe it is done via the setproctitle function.

 #include <sys/types.h>
 #include <unistd.h>
 void
 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.

2

Usually you need to change argv directly, here's an example: http://stupefydeveloper.blogspot.com/2008/10/linux-change-process-name.html

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .