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?
I believe it is done via the setproctitle function.
For Ruby specifically, there is a stackoverflow post about doing this without third party libraries.
Usually you need to change argv directly, here's an example: http://stupefydeveloper.blogspot.com/2008/10/linux-change-process-name.html