Re: Timeout on Xserver for client connections
- From: Frode Tenneboe <ft@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 12 Jan 2006 14:27:19 +0000 (UTC)
jilerner@xxxxxxxxx <jilerner@xxxxxxxxx> wrote:
> The easiest solution is to run a script in the background; the script
> that check checks periodically whether laptop is connected
> to the LAN, and if not, kills your client . Check the script below that
> does just this.
I'm already doing this. And it's not the client _process_ which is
the problem, but the client _window_ remotely displayed on the X-server.
As Alan Coopersmith pointed out, it takes two hours for the X-server to
notice that it has no connection to the owner of it's windows and
not until then removes them.
However, I did come up with a solution which works adequately:
#!/bin/sh
#Kill client if connection has been lost.
IP_ADDR1=192.168.0.2
IP_ADDR2=10.1.0.22
while true ; do
ping ${IP_ADDR1} 1 > /dev/null
STATUS_PING1=$?
ping ${IP_ADDR2} 1 > /dev/null
STATUS_PING2=$?
if [ $STATUS_PING1 != 0 -a $STATUS_PING2 != 0 ]; then
WID=`xwininfo -name ARTHUR|grep "Window id"|awk '{print $4}'`
xkill -id $WID > /dev/null
fi
sleep 15
done
(Runs on the X-server. Note that this particular variant has
two possible network connections. Hence two checks.)
-Frode
--
^ Frode Tennebø | email: Frode.Tennebo@xxxxxxxxxxxx ^
| Ericsson AS., N-1788 Halden | Phone: +47 67 25 09 39 |
| with Standard.Disclaimer; use Standard.Disclaimer; |
.
- References:
- Timeout on Xserver for client connections
- From: Frode Tenneboe
- Re: Timeout on Xserver for client connections
- From: jilerner@xxxxxxxxx
- Timeout on Xserver for client connections
- Prev by Date: Re: Is it true that x.org has worse support for xinerama?
- Next by Date: Possible to have more than one stance of X running in 1 system?
- Previous by thread: Re: Timeout on Xserver for client connections
- Next by thread: Driver and display resolution
- Index(es):
Relevant Pages
|