Setproctitle functionality makes using start-stop-daemon difficult #1372

Open
jsferrei opened this Issue Oct 16, 2016 · 6 comments

Projects

None yet

2 participants

@jsferrei

The current implementation of setproctitle functionality makes using start-stop-daemon difficult because start-stop-daemon only supports finding processes by name when those process names are shorter than 15 characters. The current "gunicorn: worker [X]" results are already past that character limit. Proposal is to add a few knobs to this section so that users have some more control over how processes are named.

@benoitc
Owner
benoitc commented Oct 16, 2016

While we can probably work around, I don't think such a simple feature needs some much settings. We have already too much configuration settings in Gunicorn. what is start-stop-daemon? Maybe there is another way to fix your issue?

@jsferrei
jsferrei commented Oct 16, 2016 edited

Would a better approach be to just add an "abbreviate" setting to the existing functionality? That would make the proctitle format be either "gcn:mst:{proc_name}" and "gcn:wrk:{proc_name}" when set? Or is it better to just add a "don't annotate" option that makes the process name exactly what the user specifies with no details added at all by gunicorn?

@benoitc
Owner
benoitc commented Oct 16, 2016

@jsferrei why not using start-stop-daemon with the --pidfile setting though ? like

start-stop-daemon --start --quiet --pidfile /path/to/gunicorn.pid --exec gunicorn -- -p /path/to/gunicorn.pid ?

@jsferrei
jsferrei commented Oct 16, 2016 edited

That was my plan for the meantime. However, it occurred to me that if gunicorn is going to have a setting to allow users to control process name, then it should probably give them more/full control over it. Happy to have this issue closed if you disagree.

@jsferrei

After having playing around with this more, it is nice to be able to use both --pidfile and --name. In the situation where gunicorn has stopped but the pidfile for some reason was not cleaned up properly, --name provides a little extra assurance that start-stop-daemon won't stop some other service that is using a recycled pid.

@benoitc
Owner
benoitc commented Oct 25, 2016 edited

if "n the situation where gunicorn has stopped but the pidfile for some reason was not cleaned up properly" is true, then this is the bug that should be fixed. Can you open a ticket for it?

I don't myself feel the need to change the current naming of the process since it has never been an issue in the last 7 years and some of us are relying on it. wondering what @tilgovi @berkerpeksag think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment