unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Updated remote script
@ 2012-01-19 16:24 Jesse Rosenthal
  2012-01-19 17:50 ` Tomi Ollila
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Rosenthal @ 2012-01-19 16:24 UTC (permalink / raw)
  To: notmuch

Dear all,

Just wanted to note that I finally got around to updating the
way-deprecated "remoteusage" wiki page[0], with a simplified
script, that takes into account comments that some have made in the
past.

Caching for attachments is gone, since the complications of part
handling vs. raw handling seems to have made it more trouble than it was
worth at the moment. (And because I do most of my work on a
well-connected machine.)

The big change in this script is that it uses dtach to set up a ssh
socket, rather than suggesting that users do so themselves with the
ControlMaster configuration option. This has the benefit of not making
anyone mess with ~/.ssh, and not impacting your other ssh work. It also
handles the issues of dead sockets on a laptop. (`ssh -Nf` seems like it
*should* work too, but emacs hangs when it is used in a script.) The
problem with this approach, of course, is that it requires dtach. A good
solution would be to (a) make the use of reusable ssh sockets optional,
and (b) allow it to use screen or tmux instead of dtach. Both would be
pretty easy, and I'll work on it at some point. But I figured getting a
two-year-old, broken script of the wiki would be a good first step.

[0] http://notmuchmail.org/remoteusage/

Best,
Jesse

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Updated remote script
  2012-01-19 16:24 Updated remote script Jesse Rosenthal
@ 2012-01-19 17:50 ` Tomi Ollila
  2012-01-19 20:31   ` Jesse Rosenthal
  0 siblings, 1 reply; 4+ messages in thread
From: Tomi Ollila @ 2012-01-19 17:50 UTC (permalink / raw)
  To: Jesse Rosenthal, notmuch

On Thu, 19 Jan 2012 11:24:32 -0500, Jesse Rosenthal <jrosenthal@jhu.edu> wrote:
> Dear all,
> 
> The big change in this script is that it uses dtach to set up a ssh
> socket, rather than suggesting that users do so themselves with the
> ControlMaster configuration option. This has the benefit of not making
> anyone mess with ~/.ssh, and not impacting your other ssh work. It also
> handles the issues of dead sockets on a laptop. (`ssh -Nf` seems like it
> *should* work too, but emacs hangs when it is used in a script.) The
> problem with this approach, of course, is that it requires dtach. A good
> solution would be to (a) make the use of reusable ssh sockets optional,
> and (b) allow it to use screen or tmux instead of dtach. Both would be
> pretty easy, and I'll work on it at some point. But I figured getting a
> two-year-old, broken script of the wiki would be a good first step.

Quick comments: "/tmp/notmuch_dtach.socket" is dangerous (and the _ssh).

either
        make directory /tmp/notmuch_`id -u`
        and chmod it to 0700
        and make sure you own it and it has right permissions.
or
        make directory for these sockets in $HOME and chmod that to 700
or
        just drop the socket in $HOME/.ssh (which should already be protected)

I personally use dtach, but basically never tmux nor screen ;)

--8<----8<----8<----8<----8<----8<----8<----8<--

In one of my scripts I do controlmaster connection in the following way:

ssh -O check "$rhost" || ssh -f -oControlMaster=yes $rhost sleep 18001
...
echo Backgroung ssh tunnel open for 5 hours.
echo SIGTERM pid `ps ax | awk '/180[0]1/ { print $1; }'` \
	In case that is not what you want.

and then  ssh -oControlMaster=no $rhost command args
to do the jobs...

> [0] http://notmuchmail.org/remoteusage/

more later..

> Best,
> Jesse


Tomi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Updated remote script
  2012-01-19 17:50 ` Tomi Ollila
@ 2012-01-19 20:31   ` Jesse Rosenthal
  2012-01-20 11:02     ` Tomi Ollila
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Rosenthal @ 2012-01-19 20:31 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Hi Tomi,

On Thu, 19 Jan 2012 19:50:38 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> Quick comments: "/tmp/notmuch_dtach.socket" is dangerous (and the _ssh).
> 
> either
>         make directory /tmp/notmuch_`id -u`
>         and chmod it to 0700
>         and make sure you own it and it has right permissions.
> or
>         make directory for these sockets in $HOME and chmod that to 700
> or
>         just drop the socket in $HOME/.ssh (which should already be
>         protected)

Thanks very much for that. I made some quick changes, based on your
first suggestion above. I'm pretty sure the checks are not in the most
optimal order, but it seemed worth getting the changes up.

As always, of course, anyone is more than welcome to change and improve
the version up there. I was mainly changing it just to get my last
error-ridden version out of circulation.

Thanks again,
Jesse

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Updated remote script
  2012-01-19 20:31   ` Jesse Rosenthal
@ 2012-01-20 11:02     ` Tomi Ollila
  0 siblings, 0 replies; 4+ messages in thread
From: Tomi Ollila @ 2012-01-20 11:02 UTC (permalink / raw)
  To: Jesse Rosenthal, notmuch

On Thu, 19 Jan 2012 15:31:02 -0500, Jesse Rosenthal <jrosenthal@jhu.edu> wrote:
> Hi Tomi,
> 
> On Thu, 19 Jan 2012 19:50:38 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> > Quick comments: "/tmp/notmuch_dtach.socket" is dangerous (and the _ssh).
> > 
> > either
> >         make directory /tmp/notmuch_`id -u`
> >         and chmod it to 0700
> >         and make sure you own it and it has right permissions.
> > or
> >         make directory for these sockets in $HOME and chmod that to 700
> > or
> >         just drop the socket in $HOME/.ssh (which should already be
> >         protected)
> 
> Thanks very much for that. I made some quick changes, based on your
> first suggestion above. I'm pretty sure the checks are not in the most
> optimal order, but it seemed worth getting the changes up.

Indeed!

> As always, of course, anyone is more than welcome to change and improve
> the version up there. I was mainly changing it just to get my last
> error-ridden version out of circulation.

I'll probably play with that in (far ;) future...

> 
> Thanks again,
> Jesse

Thanks, good script!

Tomi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-20 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-19 16:24 Updated remote script Jesse Rosenthal
2012-01-19 17:50 ` Tomi Ollila
2012-01-19 20:31   ` Jesse Rosenthal
2012-01-20 11:02     ` Tomi Ollila

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).