Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: timeout problem in ssh sessions
- X-seq: zsh-users 12579
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: ZSH User List <zsh-users@xxxxxxxxxx>
- Subject: Re: timeout problem in ssh sessions
- Date: Fri, 15 Feb 2008 14:57:02 +0100
- In-reply-to: <20080215103220.GF31852@xxxxxxxxx>
- Mail-followup-to: ZSH User List <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <080212083755.ZM20121@xxxxxxxxxxxxxxxxxxxxxx> <20080212232947.GA13793@xxxxxxxxx> <080212200708.ZM20711@xxxxxxxxxxxxxxxxxxxxxx> <20080213134200.GB31852@xxxxxxxxx> <200802131349.m1DDnXRF004831@xxxxxxxxxxxxxx> <27b8b8a0802130621x47568c7fo304848d02a1c6e76@xxxxxxxxxxxxxx> <20080213143803.GI619@xxxxxxxxxxxxxxxxxxx> <20080214125415.GC31852@xxxxxxxxx> <20080214180818.GO619@xxxxxxxxxxxxxxxxxxx> <20080215103220.GF31852@xxxxxxxxx>
On 2008-02-15 11:32:20 +0100, Andy Spiegl wrote:
> if whence xsel > /dev/null 2>&1; then
> LEFTOVER=`ps -eo user,pid,ppid,s,cpu,pmem,rss,vsize,bsdstart,etime,bsdtime,cmd | /bin/grep -v "etime,bsdtime,cmd" | /bin/grep -iE xsel | /bin/grep -v "grep -iE"`
> if [[ -n $LEFTOVER ]]; then
> echo 'Leftover "xsel" process:'
> echo $LEFTOVER
>
> # kill xsel (started by .zsh/functions/mouse.support) if in a ssh session
> # otherwise sshd will hang until the X clipboard is read or cleared
> if [[ -z ${OSTYPE:#linux*} && -n $SSH_CLIENT &&
> ${(M)${(f)"$(</proc/$PPID/status)"}:#Name:*} == Name:[[:blank:]]sshd ]]; then
> echo -n "Terminating xsel..."
> xsel -c -b
> echo -e "done.\n"
>
> # or kill the parent sshd (pretty brutal, might close other programs!)
> # kill -HUP $PPID 2>/dev/null
I think it would probably be better to kill the parent sshd, as if you
have two ssh sessions to the same machine, terminating the first one
will also terminate xsel for the other one.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author