From nobody@FreeBSD.org  Fri Nov 23 06:09:33 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 90A00D35
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Nov 2012 06:09:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 77FF18FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Nov 2012 06:09:33 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN69X5f082205
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Nov 2012 06:09:33 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qAN69XEg082204;
	Fri, 23 Nov 2012 06:09:33 GMT
	(envelope-from nobody)
Message-Id: <201211230609.qAN69XEg082204@red.freebsd.org>
Date: Fri, 23 Nov 2012 06:09:33 GMT
From: "dcarmich@dcarmichael.net" <Douglas.Carmichael@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: I have fixed x11/slim so that the slim login manager terminates properly
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: henry.hu.sh@gmail.com

>Number:         173852
>Category:       ports
>Synopsis:       I have fixed x11/slim so that the slim login manager terminates properly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    madpilot
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 23 06:10:00 UTC 2012
>Closed-Date:    Tue Nov 27 23:11:38 UTC 2012
>Last-Modified:  Tue Nov 27 23:11:38 UTC 2012
>Originator:     dcarmich@dcarmichael.net
>Release:        9.0-RELEASE
>Organization:
n/a
>Environment:
FreeBSD dc-freebsd90.carmichael.lan 9.0-RELEASE-p4 FreeBSD 9.0-RELEASE-p4 #0: Fri Aug 24 15:12:26 CDT 2012     root@dc-freebsd90.carmichael.lan:/usr/src/sys/amd64/compile/VMWARE90-64  amd64
>Description:
I have fixed the startup/shutdown script for the slim login manager so that slim can terminate properly upon a 'stop' command.

(The PID was not being properly found from the output of ps.)


>How-To-Repeat:
n/a
>Fix:
A patch is attached.

Patch attached with submission follows:

diff -ruN slim.orig/files/slim.in slim/files/slim.in
--- slim.orig/files/slim.in	2012-11-23 00:01:02.000000000 -0600
+++ slim/files/slim.in	2012-11-23 00:01:38.000000000 -0600
@@ -61,7 +61,7 @@
 
 	find_pidfile
 
-	xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth'`
+	xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth' | awk '{print $1};'`
 	xpid="${xpid## }"
 	[ -n "$xpid" ] && kill ${xpid%% *}
 }


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Fri Nov 23 06:10:08 UTC 2012 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: henry.hu.sh@gmail.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/173852: I have fixed x11/slim so that the slim login manager terminates properly
Date: Fri, 23 Nov 2012 06:10:07 UT

 Maintainer of x11/slim,
 
 Please note that PR ports/173852 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/173852
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Henry Hu <henry.hu.sh@gmail.com>
To: bug-followup@freebsd.org, Douglas.Carmichael@freebsd.org, 
	Doug Barton <dougb@freebsd.org>
Cc:  
Subject: Re: ports/173852: I have fixed x11/slim so that the slim login
 manager terminates properly
Date: Sat, 24 Nov 2012 00:04:59 -0500

 --f46d0444ef318ddaba04cf36a51b
 Content-Type: multipart/alternative; boundary=f46d0444ef318ddaaf04cf36a519
 
 --f46d0444ef318ddaaf04cf36a519
 Content-Type: text/plain; charset=ISO-8859-1
 
 In the original script, we have
 
         xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth'`
         xpid="${xpid## }"
         [ -n "$xpid" ] && kill ${xpid%% *}
 
 Since we first do xpid="${xpid## }", if there is a leading space, we will
 strip it.
 Since we do "kill ${xpid%% *}", the argument of kill should be the part of
 the $xpid before the first space.
 
 So if there are more than 1 leading space, then we may have leading space
 left in $xpid after the first step, so in the second step we would get an
 empty string as the argument of kill.
 
 Maybe this caused your problem. Can you verify that when it does not work
 properly, there are at least 2 leading spaces in $xpid before the first
 step?
 I think the fix is ok, but with awk we can simplify the script. I've
 attached my patch.
 
 
 -- 
 Cheers,
 Henry
 
 --f46d0444ef318ddaaf04cf36a519
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 In the original script, we have<br><br>=A0=A0=A0=A0=A0=A0=A0 xpid=3D`ps -ax=
 ww | grep &#39;/bin/[X] .* -auth /var/run/slim.auth&#39;`<br>=A0=A0=A0=A0=
 =A0=A0=A0 xpid=3D&quot;${xpid## }&quot;<br>=A0=A0=A0=A0=A0=A0=A0 [ -n &quot=
 ;$xpid&quot; ] &amp;&amp; kill ${xpid%% *}<br>
 
 <br>Since we first do xpid=3D&quot;${xpid## }&quot;, if there is a leading =
 space, we will strip it.<br>Since we do &quot;kill ${xpid%% *}&quot;, the a=
 rgument of kill should be the part of the $xpid before the first space.<br>
 
 <br>So if there are more than 1 leading space, then we may have leading spa=
 ce left in $xpid after the first step, so in the second step we would get a=
 n empty string as the argument of kill.<br><br>Maybe this caused your probl=
 em. Can you verify that when it does not work properly, there are at least =
 2 leading spaces in $xpid before the first step?<br>
 
 I think the fix is ok, but with awk we can simplify the script. I&#39;ve at=
 tached my patch.<br><br clear=3D"all"><br>-- <br>Cheers,<br>Henry<br>
 
 --f46d0444ef318ddaaf04cf36a519--
 --f46d0444ef318ddaba04cf36a51b
 Content-Type: application/octet-stream; name="slim_rc.patch"
 Content-Disposition: attachment; filename="slim_rc.patch"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_h9w9xeip0
 
 LS0tIGZpbGVzL3NsaW0uaW4ub3JpZwkyMDEyLTExLTE3IDAxOjAzOjE5LjAwMDAwMDAwMCAtMDUw
 MAorKysgZmlsZXMvc2xpbS5pbgkyMDEyLTExLTIzIDIzOjU4OjQzLjAwMDAwMDAwMCAtMDUwMApA
 QCAtNjEsOSArNjEsOCBAQAogCiAJZmluZF9waWRmaWxlCiAKLQl4cGlkPWBwcyAtYXh3dyB8IGdy
 ZXAgJy9iaW4vW1hdIC4qIC1hdXRoIC92YXIvcnVuL3NsaW0uYXV0aCdgCi0JeHBpZD0iJHt4cGlk
 IyMgfSIKLQlbIC1uICIkeHBpZCIgXSAmJiBraWxsICR7eHBpZCUlICp9CisJeHBpZD1gcHMgLWF4
 d3cgfCBncmVwICcvYmluL1tYXSAuKiAtYXV0aCAvdmFyL3J1bi9zbGltLmF1dGgnIHwgZ3JlcCAt
 diBncmVwIHwgYXdrICd7cHJpbnQgJDF9OydgCisJWyAtbiAiJHhwaWQiIF0gJiYga2lsbCAkeHBp
 ZAogfQogCiBydW5fcmNfY29tbWFuZCAiJDEiCg==
 --f46d0444ef318ddaba04cf36a51b--

From: Henry Hu <henry.hu.sh@gmail.com>
To: bug-followup@freebsd.org, Douglas Carmichael <dcarmich@dcarmichael.net>, 
	Doug Barton <dougb@freebsd.org>
Cc:  
Subject: Re: ports/173852: I have fixed x11/slim so that the slim login
 manager terminates properly
Date: Sat, 24 Nov 2012 15:04:57 -0500

 --e89a8ff1cb2c1e76ff04cf4338fd
 Content-Type: text/plain; charset=ISO-8859-1
 
 The new patch is tested and verified. Please commit it.
 
 -- 
 Cheers,
 Henry
 
 --e89a8ff1cb2c1e76ff04cf4338fd--
State-Changed-From-To: feedback->open 
State-Changed-By: linimon 
State-Changed-When: Sat Nov 24 20:12:52 UTC 2012 
State-Changed-Why:  
Maintainer approved. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173852 
Responsible-Changed-From-To: freebsd-ports-bugs->madpilot 
Responsible-Changed-By: madpilot 
Responsible-Changed-When: Sun Nov 25 17:18:30 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173852 
State-Changed-From-To: open->feedback 
State-Changed-By: madpilot 
State-Changed-When: Sun Nov 25 21:38:51 UTC 2012 
State-Changed-Why:  
Ask for maintainer approval. 

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

From: Guido Falsi <madpilot@FreeBSD.org>
To: bug-followup@FreeBSD.org, Douglas.Carmichael@FreeBSD.org, 
 Henry Hu <henry.hu.sh@gmail.com>
Cc:  
Subject: Re: ports/173852: I have fixed x11/slim so that the slim login manager
 terminates properly
Date: Sun, 25 Nov 2012 22:37:20 +0100

 This is a multi-part message in MIME format.
 --------------050809080303090307010106
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
 I have noticed that slim fails compilation with clang. Here is an 
 updated patch with a solution.
 
 I obtained the modification to log.h from the project's own svn repository:
 
 http://svn.berlios.de/viewvc/slim/trunk/log.h?r1=228&r2=227&pathrev=228
 
 Can you approve this? Thanks.
 
 -- 
 Guido Falsi <madpilot@FreeBSD.org>
 
 --------------050809080303090307010106
 Content-Type: text/plain; charset=us-ascii;
  name="slim.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="slim.diff"
 
 Index: Makefile
 ===================================================================
 --- Makefile	(revision 307753)
 +++ Makefile	(working copy)
 @@ -1,7 +1,4 @@
 -# New ports collection makefile for:	slim
 -# Date created:				8 Jan 2006
 -# Whom:					Tobias Roth <ports@fsck.ch>
 -#
 +# Created by: Tobias Roth <ports@fsck.ch>
  # $FreeBSD$
  
  PORTNAME=	slim
 Index: files/patch-log.h
 ===================================================================
 --- files/patch-log.h	(revision 0)
 +++ files/patch-log.h	(working copy)
 @@ -0,0 +1,15 @@
 +--- log.h.orig	2012-06-26 10:20:14.000000000 +0200
 ++++ log.h	2012-11-25 20:00:39.294546666 +0100
 +@@ -1,6 +1,12 @@
 + #ifndef _LOG_H_
 + #define _LOG_H_
 + 
 ++#ifdef USE_CONSOLEKIT
 ++#include "Ck.h"
 ++#endif
 ++#ifdef USE_CONSOLEKIT
 ++#include "PAM.h"
 ++#endif
 + #include "const.h"
 + #include <fstream>
 + 
 
 Property changes on: files/patch-log.h
 ___________________________________________________________________
 Added: fbsd:nokeywords
 ## -0,0 +1 ##
 +yes
 \ No newline at end of property
 Added: svn:eol-style
 ## -0,0 +1 ##
 +native
 \ No newline at end of property
 Added: svn:mime-type
 ## -0,0 +1 ##
 +text/plain
 \ No newline at end of property
 Index: files/slim.in
 ===================================================================
 --- files/slim.in	(revision 307753)
 +++ files/slim.in	(working copy)
 @@ -61,9 +61,8 @@
  
  	find_pidfile
  
 -	xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth'`
 -	xpid="${xpid## }"
 -	[ -n "$xpid" ] && kill ${xpid%% *}
 +	xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth' | grep -v grep | awk '{print $1};'`
 +	[ -n "$xpid" ] && kill $xpid
  }
  
  run_rc_command "$1"
 
 --------------050809080303090307010106--

From: Guido Falsi <madpilot@FreeBSD.org>
To: bug-followup@FreeBSD.org, Douglas.Carmichael@FreeBSD.org, 
 Henry Hu <henry.hu.sh@gmail.com>
Cc:  
Subject: Re: ports/173852: I have fixed x11/slim so that the slim login manager
 terminates properly
Date: Mon, 26 Nov 2012 20:33:25 +0100

 This is a multi-part message in MIME format.
 --------------090009010906030303090704
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I also forgot, the ABI version numbers should be removed from 
 LIB_DEPENDS. Also I forgot to bump PORTREVISION.
 
 I'm attaching a revised patch for approval.
 -- 
 Guido Falsi <madpilot@FreeBSD.org>
 
 --------------090009010906030303090704
 Content-Type: text/plain; charset=us-ascii;
  name="slim.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="slim.diff"
 
 Index: Makefile
 ===================================================================
 --- Makefile	(revision 307753)
 +++ Makefile	(working copy)
 @@ -1,12 +1,9 @@
 -# New ports collection makefile for:	slim
 -# Date created:				8 Jan 2006
 -# Whom:					Tobias Roth <ports@fsck.ch>
 -#
 +# Created by: Tobias Roth <ports@fsck.ch>
  # $FreeBSD$
  
  PORTNAME=	slim
  PORTVERSION=	1.3.4
 -PORTREVISION=	2
 +PORTREVISION=	3
  CATEGORIES=	x11
  MASTER_SITES=	http://slim.berlios.de/releases/
  
 @@ -15,8 +12,8 @@
  
  LICENSE=	GPLv2
  
 -LIB_DEPENDS=	jpeg.11:${PORTSDIR}/graphics/jpeg \
 -		ck-connector.0:${PORTSDIR}/sysutils/consolekit \
 +LIB_DEPENDS=	jpeg:${PORTSDIR}/graphics/jpeg \
 +		ck-connector:${PORTSDIR}/sysutils/consolekit \
  		png15:${PORTSDIR}/graphics/png \
  		freetype:${PORTSDIR}/print/freetype2 \
  		fontconfig:${PORTSDIR}/x11-fonts/fontconfig
 Index: files/patch-log.h
 ===================================================================
 --- files/patch-log.h	(revision 0)
 +++ files/patch-log.h	(working copy)
 @@ -0,0 +1,15 @@
 +--- log.h.orig	2012-06-26 10:20:14.000000000 +0200
 ++++ log.h	2012-11-25 20:00:39.294546666 +0100
 +@@ -1,6 +1,12 @@
 + #ifndef _LOG_H_
 + #define _LOG_H_
 + 
 ++#ifdef USE_CONSOLEKIT
 ++#include "Ck.h"
 ++#endif
 ++#ifdef USE_CONSOLEKIT
 ++#include "PAM.h"
 ++#endif
 + #include "const.h"
 + #include <fstream>
 + 
 
 Property changes on: files/patch-log.h
 ___________________________________________________________________
 Added: svn:mime-type
 ## -0,0 +1 ##
 +text/plain
 \ No newline at end of property
 Added: fbsd:nokeywords
 ## -0,0 +1 ##
 +yes
 \ No newline at end of property
 Added: svn:eol-style
 ## -0,0 +1 ##
 +native
 \ No newline at end of property
 Index: files/slim.in
 ===================================================================
 --- files/slim.in	(revision 307753)
 +++ files/slim.in	(working copy)
 @@ -61,9 +61,8 @@
  
  	find_pidfile
  
 -	xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth'`
 -	xpid="${xpid## }"
 -	[ -n "$xpid" ] && kill ${xpid%% *}
 +	xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth' | grep -v grep | awk '{print $1};'`
 +	[ -n "$xpid" ] && kill $xpid
  }
  
  run_rc_command "$1"
 
 --------------090009010906030303090704--

From: Henry Hu <henry.hu.sh@gmail.com>
To: bug-followup@freebsd.org, Douglas Carmichael <dcarmich@dcarmichael.net>, 
	Guido Falsi <madpilot@freebsd.org>
Cc:  
Subject: Re: ports/173852: I have fixed x11/slim so that the slim login
 manager terminates properly
Date: Mon, 26 Nov 2012 23:43:36 -0500

 --047d7b15af1f9ddbbe04cf72b2b9
 Content-Type: text/plain; charset=ISO-8859-1
 
 The patch looks ok. Shall we combine the two #ifdef?
 
 -- 
 Cheers,
 Henry
 
 --047d7b15af1f9ddbbe04cf72b2b9
 Content-Type: text/html; charset=ISO-8859-1
 
 The patch looks ok. Shall we combine the two #ifdef?<br clear="all"><br>-- <br>Cheers,<br>Henry<br>
 
 --047d7b15af1f9ddbbe04cf72b2b9--

From: Guido Falsi <madpilot@FreeBSD.org>
To: Henry Hu <henry.hu.sh@gmail.com>
Cc: bug-followup@freebsd.org, 
 Douglas Carmichael <dcarmich@dcarmichael.net>
Subject: Re: ports/173852: I have fixed x11/slim so that the slim login manager
 terminates properly
Date: Tue, 27 Nov 2012 13:15:51 +0100

 On 11/27/12 05:43, Henry Hu wrote:
 > The patch looks ok. Shall we combine the two #ifdef?
 >
 
 I thought about this myself, but since I have extracted it from the 
 project's own svn repository I'd rather leave it unmodified.
 
 -- 
 Guido Falsi <madpilot@FreeBSD.org>

From: Henry Hu <henry.hu.sh@gmail.com>
To: Guido Falsi <madpilot@freebsd.org>
Cc: bug-followup@freebsd.org, Douglas Carmichael <dcarmich@dcarmichael.net>
Subject: Re: ports/173852: I have fixed x11/slim so that the slim login
 manager terminates properly
Date: Tue, 27 Nov 2012 12:33:49 -0500

 --f46d042f948a1b728304cf7d756e
 Content-Type: text/plain; charset=ISO-8859-1
 
 OK, then let's commit this.
 
 
 On Tue, Nov 27, 2012 at 7:15 AM, Guido Falsi <madpilot@freebsd.org> wrote:
 
 > On 11/27/12 05:43, Henry Hu wrote:
 >
 >> The patch looks ok. Shall we combine the two #ifdef?
 >>
 >>
 > I thought about this myself, but since I have extracted it from the
 > project's own svn repository I'd rather leave it unmodified.
 >
 > --
 > Guido Falsi <madpilot@FreeBSD.org>
 >
 
 
 
 -- 
 Cheers,
 Henry
 
 --f46d042f948a1b728304cf7d756e
 Content-Type: text/html; charset=ISO-8859-1
 
 OK, then let&#39;s commit this.<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 27, 2012 at 7:15 AM, Guido Falsi <span dir="ltr">&lt;<a href="mailto:madpilot@freebsd.org" target="_blank">madpilot@freebsd.org</a>&gt;</span> wrote:<br>
 
 <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 11/27/12 05:43, Henry Hu wrote:<br>
 <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 The patch looks ok. Shall we combine the two #ifdef?<br>
 <br>
 </blockquote>
 <br></div>
 I thought about this myself, but since I have extracted it from the project&#39;s own svn repository I&#39;d rather leave it unmodified.<span class="HOEnZb"><font color="#888888"><br>
 <br>
 -- <br>
 Guido Falsi &lt;madpilot@FreeBSD.org&gt;<br>
 </font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Cheers,<br>Henry<br>
 </div>
 
 --f46d042f948a1b728304cf7d756e--
State-Changed-From-To: feedback->closed 
State-Changed-By: madpilot 
State-Changed-When: Tue Nov 27 23:11:38 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173852 
>Unformatted:
