ports/125628: [patch] www/mod_wsgi: add support for display-name
Emil Mikulic
emikulic at gmail.com
Tue Jul 15 09:30:02 UTC 2008
>Number: 125628
>Category: ports
>Synopsis: [patch] www/mod_wsgi: add support for display-name
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Tue Jul 15 09:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Emil Mikulic
>Release: FreeBSD 7.0-STABLE i386
>Organization:
>Environment:
>Description:
The patch in the Fix: section uses setproctitle() to set the
display-name for WSGI children.
e.g. in httpd.conf:
WSGIDaemonProcess moin display-name=wsgi-moin
pstree output becomes:
|-+= 06591 root /usr/local/sbin/httpd
| |--- 06592 www httpd: wsgi-moin (httpd)
| |--- 06593 www httpd: wsgi-moin (httpd)
| |--- 06594 www /usr/local/sbin/httpd
| |--- 06595 www /usr/local/sbin/httpd
| \--- 06596 www /usr/local/sbin/httpd
CC'd port maintainer.
>How-To-Repeat:
Set a display-name in httpd.conf
>Fix:
--- mod_wsgi.c.orig 2008-03-20 15:36:46.000000000 +1100
+++ mod_wsgi.c 2008-07-15 19:01:38.000000000 +1000
@@ -7768,23 +7768,27 @@ static void wsgi_setup_daemon_name(WSGID
* Only argv[0] is guaranteed to be the real things as MPM
* modules may make modifications to subsequent arguments.
* Thus can only replace the argv[0] value. Because length
* is restricted, need to truncate display name if too long.
*/
+#ifdef __FreeBSD__
+ setproctitle(display_name);
+#else
argv0 = (char*)wsgi_server->process->argv[0];
dlen = strlen(argv0);
slen = strlen(display_name);
memset(argv0, ' ', dlen);
if (slen < dlen)
memcpy(argv0, display_name, slen);
else
memcpy(argv0, display_name, dlen);
+#endif
}
static void wsgi_setup_access(WSGIDaemonProcess *daemon)
{
/* Setup the umask for the effective user. */
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list