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

@donovanhide donovanhide commented Sep 6, 2012

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

This comment has been minimized.

Copy link
Contributor

@davecheney davecheney commented Sep 12, 2012

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

This comment has been minimized.

Copy link
Contributor

@rsc 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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Sep 24, 2013

Comment 3 by erik@dubbelboer.com:

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

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Nov 27, 2013

Comment 4:

Labels changed: added go1.3maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Dec 4, 2013

Comment 5:

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

@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Dec 4, 2013

Comment 6:

Labels changed: added repo-main.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 2, 2014

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.