[erlang-questions] Set program name

Max Lapshin <>
Sat Nov 8 14:10:33 CET 2014


When one launches erlang, ps or top shows long path to beam.smp, then many
useless command line options, then many-many -pa commands and only in the
very end something like -s

So it is rather hard to distinguish one erlang program from another.

It would be very good to have an API for changing current process name.

Looks like this feature is very complicated to port between different OS.

For example in Linux there must be combined two methods: change argv[0] and
call prctl.

In MacOS it is required to summon a devil ^W  call some tricky code like:
https://github.com/openwebos/nodejs/blob/7272321dffae49f67c3d128aedb27bebc3790398/src/platform_darwin_proctitle.cc
This code partially works under macos, it changes process name in
ActivityMonitor, but doesn't change in top/ps


But it seems that it is always required to change argv[0]

Have anyone tried to do it?  It seems that original argc,argv are lost in
erl_start function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141108/32067cc0/attachment.html>


More information about the erlang-questions mailing list