Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jul 2008 19:06:23 +1000 (EST)
From:      Emil Mikulic <emikulic@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        douglas@douglasthrift.net
Subject:   ports/125628: [patch] www/mod_wsgi: add support for display-name
Message-ID:  <20080715090623.CD26B4080@ppp162-186.static.internode.on.net>
Resent-Message-ID: <200807150930.m6F9U2v3069562@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080715090623.CD26B4080>