Date: Sat, 24 Nov 2012 05:10:01 GMT From: Henry Hu <henry.hu.sh@gmail.com> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/173852: I have fixed x11/slim so that the slim login manager terminates properly Message-ID: <201211240510.qAO5A1WC021768@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/173852; it has been noted by GNATS. 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 '/bin/[X] .* -auth /var/run/slim.auth'`<br>=A0=A0=A0=A0= =A0=A0=A0 xpid=3D"${xpid## }"<br>=A0=A0=A0=A0=A0=A0=A0 [ -n "= ;$xpid" ] && kill ${xpid%% *}<br> <br>Since we first do xpid=3D"${xpid## }", if there is a leading = space, we will strip it.<br>Since we do "kill ${xpid%% *}", 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'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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211240510.qAO5A1WC021768>