[PATCH 4 of 4] chg: change server's process title

Yuya Nishihara yuya at tcha.org
Thu Aug 11 20:26:37 EDT 2016


On Thu, 11 Aug 2016 18:28:09 +0100, Jun Wu wrote:
> Excerpts from Yuya Nishihara's message of 2016-08-12 01:55:44 +0900:
> > Maybe we'll need setproctitle() equivalent for Linux which will update argv?
> 
> That would be probably rewriting argv[0], afaik. I think it is impossible
> to get the "argv" pointer in a reasonable way.

Er, Py_GetArgcArgv() ? No idea if we can reliably use this hidden API.

https://hg.python.org/cpython/file/v2.7.11/Modules/main.c#l691

> > 16-char limitation of prctl() would come from pthread API. If we want to
> > extend the (ab)use of process title to hgweb, PR_SET_NAME won't be useful.
> > It won't be displayed in normal ps output.
> 
> It's still useful with '-O comm', and atop will record it. prctl is lower
> level than pthread. Sadly 16 is hardcoded in Linux.

I assume '-O comm' would be less common for Linux sysadmins.


More information about the Mercurial-devel mailing list