From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Nov 24 05:10:01 2012 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 963C2E39 for ; Sat, 24 Nov 2012 05:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0F88FC08 for ; Sat, 24 Nov 2012 05:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO5A1MQ021769 for ; Sat, 24 Nov 2012 05:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qAO5A1WC021768; Sat, 24 Nov 2012 05:10:01 GMT (envelope-from gnats) Date: Sat, 24 Nov 2012 05:10:01 GMT Message-Id: <201211240510.qAO5A1WC021768@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org Cc: From: Henry Hu Subject: Re: ports/173852: I have fixed x11/slim so that the slim login manager terminates properly X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Henry Hu List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 05:10:01 -0000 The following reply was made to PR ports/173852; it has been noted by GNATS. From: Henry Hu To: bug-followup@freebsd.org, Douglas.Carmichael@freebsd.org, Doug Barton 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

=A0=A0=A0=A0=A0=A0=A0 xpid=3D`ps -ax= ww | grep '/bin/[X] .* -auth /var/run/slim.auth'`
=A0=A0=A0=A0= =A0=A0=A0 xpid=3D"${xpid## }"
=A0=A0=A0=A0=A0=A0=A0 [ -n "= ;$xpid" ] && kill ${xpid%% *}

Since we first do xpid=3D"${xpid## }", if there is a leading = space, we will strip it.
Since we do "kill ${xpid%% *}", the a= rgument 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 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.

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?
I think the fix is ok, but with awk we can simplify the script. I've at= tached my patch.


--
Cheers,
Henry
--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--