On Thu, Jul 29, 2010 at 10:16 AM, Daniel Kahn Gillmor <d...@fifthhorseman.net> wrote: > Cc'ing xdotool-users, as upstream might be interested here. > > for those just now seeing it, the bug discussed is: > > http://bugs.debian.org/590827 > > xdotool: FTBFS on GNU/kFreeBSD (due to unsatisfied Build-Depends on lsof) > > On 07/29/2010 01:54 PM, Petr Salinger wrote: >> But it looks like the usage of lsof can be avoided. >> Wouldn'be possible to use lsof when available and otherwise use simply >> "test -S" ? > > test -S just checks for the presence of the socket, not whether anyone > is actively listening on it. It is possible (at least with a Linux > kernel -- haven't tested other kernels) for a socket to exist in the > filesystem with no processes bound to it. > > So i don't think test -S $FOO a semantic equivalent to lsof $FOO in this > case. >
(introductions - I am the upstream) I think given ephemeral-x.sh tries, best effort, to find an available X display that's not in use, test -S is probably fine given it's available on freebsd and linux. If we skip a file because it exists, not because it is in use, I think the harm is pretty minimal if any. I'll try the test suite with test -S instead and push a new release if this looks good enough. > Getting lsof working for GNU/kFreeBSD seems to have other good > consequences (like having lsof available!), and would solve this problem > directly. > FreeBSD has lsof in sysutils/lsof, so I'm not sure what keeps GNU/kFreeBSD from having lsof. FreeBSD also has sockstat in base, though GNU/kFreeBSD probably ignores all of FreeBSD's userland world? I don't know. > I'd rather not disable test suites for xdotool if possible, though i'd > be happy to entertain other suggestions for resolving this. +1. Don't disable the tests; in general, I'm happy to work with you to ensure stuff stays working and to minimize downstream patches. -Jordan > --dkg > >> --- t/ephemeral-x.STD 2010-07-29 15:33:59.000000000 +0000 >> +++ t/ephemeral-x.sh 2010-07-29 15:35:17.000000000 +0000 >> @@ -66,17 +66,17 @@ >> exit 1 >> fi >> >> -if ! which lsof > /dev/null 2>&1 ; then >> - echo "Unable to find lsof. This is a required tool." >> - cleanup >> - exit 1 >> -fi >> +#if ! which lsof > /dev/null 2>&1 ; then >> +# echo "Unable to find lsof. This is a required tool." >> +# cleanup >> +# exit 1 >> +#fi >> >> while true; do >> num=$(expr $num + 1) >> xsocket=/tmp/.X11-unix/X$num >> quiet || echo "Trying :$num" >> - lsof $xsocket > /dev/null 2>&1 && continue >> + test -S $xsocket > /dev/null 2>&1 && continue >> ( >> if quiet ; then >> exec > /dev/null >> @@ -97,7 +97,7 @@ >> >> # See if the xserver got a hold of the display socket. >> # If so, the server is up and healthy. >> - if lsof -p $xpid | grep -qF $xsocket ; then >> + if test -S $xsocket ; then >> quiet || echo "$XSERVERNAME looks healthy. Moving on." >> healthy=1 >> break >> >> >> >> >> > > -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org