Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 4CE60431FB6 for ; Sat, 5 Feb 2011 15:58:33 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qfc8K587-hdg for ; Sat, 5 Feb 2011 15:58:32 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id A7B2F431FB5 for ; Sat, 5 Feb 2011 15:58:32 -0800 (PST) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 003EB19F3414; Sun, 6 Feb 2011 00:58:32 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id fQLY-rpozG5Z; Sun, 6 Feb 2011 00:58:30 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 85F7519F3411; Sun, 6 Feb 2011 00:58:30 +0100 (CET) Received: from wsheee.2x.cz (unknown [213.29.198.144]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 8471E15C031; Sun, 6 Feb 2011 00:58:30 +0100 (CET) Received: from wsh by wsheee.2x.cz with local (Exim 4.72) (envelope-from ) id 1Pls1N-0007nU-M0; Sun, 06 Feb 2011 00:58:29 +0100 From: Michal Sojka To: Jesse Rosenthal , notmuch@notmuchmail.org Subject: Re: Remote usage script updated In-Reply-To: <87aaibylqe.fsf@steelpick.2x.cz> References: <87oc72xs35.fsf@lucky.home> <87aaibylqe.fsf@steelpick.2x.cz> User-Agent: Notmuch/0.5-103-g1253785 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Sun, 06 Feb 2011 00:58:29 +0100 Message-ID: <87tygiowyi.fsf@wsheee.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Feb 2011 23:58:33 -0000 On Sat, 05 Feb 2011, Michal Sojka wrote: > On Thu, 27 Jan 2011, Jesse Rosenthal wrote: > > A future feature might be to integrate the ControlMaster feature of > > openssh into the script, instead of having to open a connection > > manually, but there are some complications there (dead sockets still > > around if you go offline, etc.). > > In another project I worked around the dead sockets this way: > > sshgw() { > local socket="$HOME/.ssh/cangw-connection" > > if [[ ! -S $socket ]] || ! ssh -x -a -S $socket root@192.168.2.3 true; then > # Create master connection to speed up subsequent commands. > ssh -N -f -M -S $socket root@192.168.2.3 >/dev/null 2>&1 > fi > ssh -x -a -S $socket root@192.168.2.3 "$@" > } Hmm, this code worked well with dropbear ssh server but it seems that with openssh server the result is not that good. Namely, if the master connection is dead, the command running true blocked for a long time. I have always killed it before it timed out so I don't know whether it blocks indefinitely or there is only long timeout. I may look at this later, but I use notmuch remotely only from time to time so this is not priority for me. -Michal