Here's a patch to add in System.setproctitle() for systems that have it.
Adam
On Tue, 7 Mar 2006 16:17:46 -0500 Adam Montague amontague@siriushosting.com wrote:
Here's a patch to add in System.setproctitle() for systems that have it.
Adam
Any comments on this? Any objections? Its kinda nice for apps like mine where ps output is normally ~250 characters wide, to reduce it to just
"pike: Myapp running in mydir (pike)"
And for making the current status of the app visable through ps.
Adam
I vagely recall some security concerns last time this was suggested. Anyone remember more?
My only comment is that it's not cross platform; we experimented a while back trying to get something similar that was cross platform, and there are some operating systems that simply don't allow you to change the process title (Solaris is one of them, I don't think /usr/ucb/ps worked).
There's similar code in the Caudium CVS repository, I don't recall whether it had other fallbacks for systems that don't support setproctitle (like mucking with argv)...
Bill
On Mon, 20 Mar 2006, Adam Montague wrote:
On Tue, 7 Mar 2006 16:17:46 -0500 Adam Montague amontague@siriushosting.com wrote:
Here's a patch to add in System.setproctitle() for systems that have it.
Adam
Any comments on this? Any objections? Its kinda nice for apps like mine where ps output is normally ~250 characters wide, to reduce it to just
"pike: Myapp running in mydir (pike)"
And for making the current status of the app visable through ps.
Adam
It's kind of nice, but someone should look up the heated debate we had about this some time ago. I think there was something that needed to be fixed before we could add it. That or we got tired of yelling at eachother.
On Mon, 20 Mar 2006 22:05:01 +0000 (UTC) "Peter Bortas (nu med mindre Opera) @ Pike (-) developers forum" 10353@lyskom.lysator.liu.se wrote:
It's kind of nice, but someone should look up the heated debate we had about this some time ago. I think there was something that needed to be fixed before we could add it. That or we got tired of yelling at eachother.
All I could find was an "argv[0]" thread that barely mentioned changing the processes title, it was mostly arguing about fork() and threads. I certainly couldn't find any resolution one way or the other in the archives anyhow.
For what is worth, the patch just puts a wrapper around setproctitle for the systems that have it (just BSDs as far as I know), and has no effect on systems without it. I don't mind digging up the hacks required to do the same thing on other unixy systems if the code will be used.
Adam
That would probably be the one. Cross platform is nice and all, but it doesn't really matter as long as it's in System.
Something similar is added to Pike 7.7.
Something similar is added to Pike 7.7.
pike-devel@lists.lysator.liu.se