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 54954431FD0 for ; Tue, 15 Feb 2011 13:42:49 -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 rJVFppGvILd5 for ; Tue, 15 Feb 2011 13:42:48 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 504B5431FB5 for ; Tue, 15 Feb 2011 13:42:48 -0800 (PST) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 793523CFE9F; Tue, 15 Feb 2011 22:42:46 +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 KyxHjl+bIZTa; Tue, 15 Feb 2011 22:42:44 +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 D891B19F331A; Tue, 15 Feb 2011 22:42:44 +0100 (CET) Received: from wsheee.2x.cz (unknown [213.29.198.144]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id BAD6315C031; Tue, 15 Feb 2011 22:42:44 +0100 (CET) Received: from wsh by wsheee.2x.cz with local (Exim 4.72) (envelope-from ) id 1PpSfa-0007sk-Rr; Tue, 15 Feb 2011 22:42:50 +0100 From: Michal Sojka To: Jesse Rosenthal , notmuch@notmuchmail.org Subject: Re: Remote usage script updated In-Reply-To: References: <87oc72xs35.fsf@lucky.home> <87aaibylqe.fsf@steelpick.2x.cz> <87tygiowyi.fsf@wsheee.2x.cz> User-Agent: Notmuch/0.5-103-g1253785 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Tue, 15 Feb 2011 22:42:50 +0100 Message-ID: <87lj1hrn39.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: Tue, 15 Feb 2011 21:42:49 -0000 On Wed, 09 Feb 2011, Jesse Rosenthal wrote: > Michal, > > On Sun, 06 Feb 2011 00:58:29 +0100, Michal Sojka wrote: > > 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. > > Seemed to work okay for me when I played around with it a bit (in > different circumstances, and with a confused laptop waking up from > hibernation). But I'll hold off on updating it till I can figure out the > most reliable way. Hi Jesse, I've just found that there is a SSH option called ControlPersist and this is the missing piece to reliable connection sharing for notmuch remote script. This option is available since openssh 5.6 (http://www.openssh.org/txt/release-5.6) with a fix of race conditions in 5.7 (http://www.openssh.org/txt/release-5.7). Now I have in my script the following command: ssh -x -a -oControlMaster=auto -oControlPersist=600 -S $SOCKET $USER@$SSH_HOST $NOTMUCH_REMOTE_BIN ${CMD} ${args} where SOCKET="${CACHE}/.ssh-socket-${USER}@${SSH_HOST}" and it works perfectly. Unfortunately, this option is not supported in recently released Debian Squeeze but from http://bugs.debian.org/594295 seems that it might be supported later, perhaps in a point release. -Michal