Hi,

In message "Re: $0 is truncated"
    on Sun, 17 May 2009 02:22:45 +0900, Brian Candler <b.candler / pobox.com> writes:

|This is under Linux (Ubuntu Hardy).
|
|Yes, I'm aware that maybe setproctitle has limits, but it's also useful 
|to set $0 to a longer Ruby string (even if that's not fully reflecting 
|in the proctitle), because another piece of Ruby code in the same 
|process may be testing the value of $0.
|
|In ruby 1.8.6, I can use $0.replace("any long string") which works just 
|fine for setting $0 - presumably not setting the proctitle of course. 
|But this stopped working in 1.8.7/1.9 because $0 is frozen.

OK, choose either from the following.

  [ ] it's OK (for you) that $0 is not corresponding to process name
      read by ps etc. at all, i.e. if you set $0 longer than the
      limit, $0 will be updated but the proc title will not.

  [ ] it's OK (for you) that $0 is not always corresponding to process
      name read by ps etc.; in this case if you set $0 longer than the
      limit, $0 will be updated but the proc title will be truncated to
      the limit.

  [ ] it's important for you to just update the $0, so that $0 string
      should not be frozen to allow replacing.  When you replace $0
      string, you'd take the responsibility.

							matz.