Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: add SetProcName #4053

Closed
donovanhide opened this issue Sep 6, 2012 · 7 comments
Closed

os: add SetProcName #4053

donovanhide opened this issue Sep 6, 2012 · 7 comments

Comments

@donovanhide
Copy link
Contributor

It would be very useful to be able to change the process name for reference in tools
like top. This is especially useful when a go executable starts additional processes of
the same executable. This is a useful workaround for when the 16GB memory limit is
reached. It would be ideal if a method:

func (p *Process) SetName(name string) error

could be exported from the os package and any platform specific code added to the
syscall package such as:

prctl.set_proctitle for Linux

I believe OS X requires overwriting/exposing argv to achieve the same effect. 

There is an equivalent module for Python with lots of platform specific code:

https://github.com/dvarrazzo/py-setproctitle

Cheers,
Donovan.
@davecheney
Copy link
Contributor

Comment 1:

I would like to see this implemented as a 3rdparty library if possible. It looks like
most solutions overwrite the argv[0] pointer to their own stringz. The only tricky bit
is getting the address of argv[0].

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 2:

This will be very grungy.

Labels changed: added priority-later, removed priority-triage.

Status changed to LongTerm.

@gopherbot
Copy link

Comment 3 by erik@dubbelboer.com:

I have created a package to implement setproctitle() for Go:
https://github.com/ErikDubbelboer/gspt

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 4:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 5:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 6:

Labels changed: added repo-main.

@ianlancetaylor
Copy link
Contributor

Comment 7:

There is a third party package for this (thanks!).

Labels changed: removed priority-later.

Status changed to WontFix.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants