From emil@dmr.ath.cx  Tue Jul 15 09:21:44 2008
Return-Path: <emil@dmr.ath.cx>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 07E101065671
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Jul 2008 09:21:44 +0000 (UTC)
	(envelope-from emil@dmr.ath.cx)
Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146])
	by mx1.freebsd.org (Postfix) with ESMTP id 7CFD48FC1C
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Jul 2008 09:21:43 +0000 (UTC)
	(envelope-from emil@dmr.ath.cx)
Received: from ppp162-186.static.internode.on.net ([150.101.162.186])
  by ipmail01.adl6.internode.on.net with ESMTP; 15 Jul 2008 18:36:26 +0930
Received: by ppp162-186.static.internode.on.net (Poofix, from userid 1001)
	id CD26B4080; Tue, 15 Jul 2008 19:06:23 +1000 (EST)
Message-Id: <20080715090623.CD26B4080@ppp162-186.static.internode.on.net>
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: [patch] www/mod_wsgi: add support for display-name
X-Send-Pr-Version: 3.113
X-GNATS-Notify: douglas@douglasthrift.net

>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:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 15 09:30:01 UTC 2008
>Closed-Date:    Sat Jul 19 17:50:20 UTC 2008
>Last-Modified:  Sat Jul 19 18:00:06 UTC 2008
>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:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Tue Jul 15 09:30:12 UTC 2008 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125628 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: douglas@douglasthrift.net
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/125628: [patch] www/mod_wsgi: add support for display-name
Date: Tue, 15 Jul 2008 09:30:09 UT

 Maintainer of www/mod_wsgi,
 
 Please note that PR ports/125628 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/125628
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: "Douglas Thrift" <douglas@douglasthrift.net>
To: <bug-followup@FreeBSD.ORG>
Cc: <bug-followup@FreeBSD.ORG>
Subject: Re: ports/125628: [patch] www/mod_wsgi: add support for display-name
Date: Tue, 15 Jul 2008 13:35:49 -0700

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_034D_01C8E67F.B1E63BB0
 Content-Type: text/plain;
 	format=flowed;
 	charset="utf-8";
 	reply-type=original
 Content-Transfer-Encoding: 7bit
 
 Hello,
 
 I've cleaned up the fix and put it into a patch that can be used to patch 
 the port.
 _______________________________________________________________________
 Douglas William Thrift
 <douglas@douglasthrift.net>
 <http://www.douglasthrift.net/>
 
 ----- Original Message ----- 
 From: "Edwin Groothuis" <edwin@FreeBSD.ORG>
 To: <douglas@douglasthrift.net>
 Cc: <bug-followup@FreeBSD.ORG>
 Sent: Tuesday, July 15, 2008 2:30 AM
 Subject: Re: ports/125628: [patch] www/mod_wsgi: add support for 
 display-name
 
 
 > Maintainer of www/mod_wsgi,
 >
 > Please note that PR ports/125628 has just been submitted.
 >
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 >
 > The full text of the PR can be found at:
 >    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/125628
 >
 > -- 
 > Edwin Groothuis via the GNATS Auto Assign Tool
 > edwin@FreeBSD.org
 >
 > 
 
 ------=_NextPart_000_034D_01C8E67F.B1E63BB0
 Content-Type: application/octet-stream;
 	name="mod_wsgi.patch"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="mod_wsgi.patch"
 
 diff -Nrux .svn -x work /usr/ports/www/mod_wsgi/files/patch-mod_wsgi.c =
 mod_wsgi/files/patch-mod_wsgi.c=0A=
 --- /usr/ports/www/mod_wsgi/files/patch-mod_wsgi.c	Wed Dec 31 16:00:00 =
 1969=0A=
 +++ mod_wsgi/files/patch-mod_wsgi.c	Tue Jul 15 13:12:53 2008=0A=
 @@ -0,0 +1,33 @@=0A=
 +--- mod_wsgi.c.orig	Tue Jul 15 13:01:00 2008=0A=
 ++++ mod_wsgi.c	Tue Jul 15 13:07:19 2008=0A=
 +@@ -7749,10 +7749,12 @@=0A=
 + {=0A=
 +     const char *display_name =3D NULL;=0A=
 + =0A=
 ++#ifndef __FreeBSD__=0A=
 +     int slen =3D 0;=0A=
 +     int dlen =3D 0;=0A=
 + =0A=
 +     char *argv0 =3D NULL;=0A=
 ++#endif=0A=
 + =0A=
 +     display_name =3D daemon->group->display_name;=0A=
 + =0A=
 +@@ -7771,6 +7773,9 @@=0A=
 +      * is restricted, need to truncate display name if too long.=0A=
 +      */=0A=
 + =0A=
 ++#ifdef __FreeBSD__=0A=
 ++    setproctitle("%s", display_name);=0A=
 ++#else=0A=
 +     argv0 =3D (char*)wsgi_server->process->argv[0];=0A=
 + =0A=
 +     dlen =3D strlen(argv0);=0A=
 +@@ -7782,6 +7787,7 @@=0A=
 +         memcpy(argv0, display_name, slen);=0A=
 +     else=0A=
 +         memcpy(argv0, display_name, dlen);=0A=
 ++#endif=0A=
 + }=0A=
 + =0A=
 + static void wsgi_setup_access(WSGIDaemonProcess *daemon)=0A=
 
 ------=_NextPart_000_034D_01C8E67F.B1E63BB0--
 
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Sat Jul 19 17:50:20 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125628 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/125628: commit references a PR
Date: Sat, 19 Jul 2008 17:50:19 +0000 (UTC)

 miwi        2008-07-19 17:50:06 UTC
 
   FreeBSD ports repository
 
   Added files:
     www/mod_wsgi/files   patch-mod_wsgi.c 
   Log:
   - Add support for display-name
   
   PR:             125628
   Submitted by:   Emil Mikulic <emikulic@gmail.com>
   Approved by:    maintainer
   
   Revision  Changes    Path
   1.1       +20 -0     ports/www/mod_wsgi/files/patch-mod_wsgi.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
