fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Executing script on localhost without ssh


From: Jeff Forcier
Subject: Re: [Fab-user] Executing script on localhost without ssh
Date: Tue, 8 Sep 2009 10:51:37 -0400

On Mon, Sep 7, 2009 at 11:38 PM, Taras Mankovski<address@hidden> wrote:

> Concrete example is right here: http://gist.github.com/181654

Whoops! Sorry about that, totally forgot you'd included that in the
original email :) Just read it over now and I can see why you said it
works correctly as-is. I guess your problem isn't technical so much as
it is mental, going by the below? (I don't mean that in a denigrating
way, FYI.)

> But that's part
> of the problem, to me ssh'ing into my own machine, seems hashish and
> strange, because I'm already in shell when I execute the command, so
> why am connecting to my machine again just to perform the actions that
> can easily be executed without creating another shell.

I just don't see why you feel this way about the "extra" SSH session
-- it's very low overhead and shouldn't be any more difficult than the
normal use-case (especially if you're using an SSH keychain and have
"ForwardAgent yes" in your ~/.ssh/config).

For example, I do this all the time on one of my work projects because
I inherited it and it already had a robust set of Capistrano scripts
for starting/stopping the various daemons. Instead of trying to screw
around and make them work as local-only Rake scripts, I simply pointed
the Cap scripts at localhost (this is on a dev VM) and bam, problem
solved.

This is, IMO, just like programming against an interface: make your
stuff work against any server offering SSH, and you can point it any
server over SSH -- even if that "server" is the local host.

So, again -- I don't see that there is any downside to SSHing back to
your local host, while your suggested change *does* have a significant
downside: more complexity in code and behavior. More complexity for no
real, solid gain is bad :(

> Looks good, but is it possible to provide more parameters or settings
> then just host_string?

Such as? Right now, sudo and run and friends are (connection-wise)
very simple, they just connect to a single host and run their course,
returning captured stdout. The host_string is all that is necessary
for this -- what else are you looking to alter? :) (serious question!
this part of Fab, intra-task host tweaking, could use some work.)

Regards,
Jeff




reply via email to

[Prev in Thread] Current Thread [Next in Thread]