<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Package: <span style="background-color: rgb(255, 255, 255); color: rgb(102, 102, 102); font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Bitstream Vera Sans Mono', 'Nimbus Mono L', Monaco, 'Courier New', monospace; line-height: 19.600000381469727px;">x2godesktopsharing</span></div><div>Version: 3.1.1.1-0~131~ubuntu12</div><div><br></div><div><br></div>Hi, my server had a ‘weird’ file in /tmp/.X11-unix/ for which xwininfo would never return, locking up x2golistdesktops.<div><br></div><div>The solution is to provide a timeout for the shell call to xwininfo. This can be accomplished either using the shell command ‘timeout’ or the Perl <span style="background-color: rgb(238, 238, 238);">IPC</span><span class="sh_symbol">::</span><span style="background-color: rgb(238, 238, 238);">Run</span> module (as described in the first response to <a href="http://stackoverflow.com/questions/16918005/time-out-when-using-system-cmd-in-perl">http://stackoverflow.com/questions/16918005/time-out-when-using-system-cmd-in-perl</a>).</div><div><br></div><div>For my purpose, I’ve used the shell timeout command. Patch below.</div><div><br></div><div>-Greg</div><div><br></div><div><br></div><div><div>--- /usr/bin/x2golistdesktops<span class="Apple-tab-span" style="white-space:pre"> </span>2014-04-03 10:14:22.000000000 -0500</div><div>+++ x2golistdesktops<span class="Apple-tab-span" style="white-space:pre"> </span>2014-07-09 16:43:54.000000000 -0500</div><div>@@ -43,7 +43,7 @@</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>$serv=hostname;</div><div> }</div><div><br></div><div>-my $rsess=`x2golistsessions x2goserver |grep _stR`;</div><div>+my $rsess=`timeout 1s x2golistsessions x2goserver |grep _stR`;</div><div> my @rsess=split("\n","$rsess");</div><div> my @rdisplays;</div><div> for (my $i=0;$i<@rsess;$i++)</div><div>@@ -67,7 +67,7 @@</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>$checkdisp="${checkdisp}I";</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>if (!( $rdisp =~ m/$checkdisp/ ))</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>{</div><div>-<span class="Apple-tab-span" style="white-space:pre"> </span>my $inf=`xwininfo -root -display $display 2> /dev/null`;</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>my $inf=`timeout 1s xwininfo -root -display $display 2> /dev/null`;</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>if ( $inf=~ m/geometry/)</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>{</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>print "$uname\@$display\n";</div><div>@@ -88,4 +88,4 @@</div><div> }</div><div><br></div><div> # closing syslog</div><div>-closelog;</div><div>\ No newline at end of file</div><div>+closelog;</div><div>w</div></div><div><br></div><div><br></div></body></html>