[racket] Can raco exe assign a name other than "racket"?
At least on my Linux, even ps -AFw truncates the command-line pretty quickly.
Plus it would be helpful to see the exe name in plain ps or in top.
Since I posted, I learned more about .pid files and such. So if I have
2 more Racket executables running, now I know how to ferret out which
is which -- provided I make a /var/run/*.pid for each, and look in
each one, and so on.
Even so, it would be helpful for the exe name to show up in ps or top,
for a more casual check of which process is which. Plus a
Racket-produced exe would appear like more of a "first-class" process.
So thank you for considering the feature request.
On Mon, Mar 28, 2011 at 9:28 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Sat, 26 Mar 2011 16:13:02 -0400, Neil Van Dyke wrote:
>> Greg Hendershott wrote at 03/26/2011 12:14 PM:
>> > $ raco exe -o foo foo.rkt
>> > $ ./foo &
>> > $ ps #shows it as "racket" not as "foo".
>> > $ top #shows it as "racket" not as "foo".
>> >
>> > Is there way I can make it show up as "foo"?
>> >
>>
>> You can often do this in C on Unix variants by mutating the string
>> buffers pointed to by "argv" argument as passed to the "main" function.
>
> That probably doesn't work under Linux, or maybe it would affect the
> output of `ps a'.
>
> But `ps a' already reports a more useful result, so that may be the
> immediate answer, Greg. Probably there's a way to make `top' show the
> same information as `ps a'.
>
> To change the name shown by `ps', it looks like Racket could call
> prctl() with PR_SET_NAME --- at least for Linux (2.6.9 and up). I'll
> look into that more.
>
>