I want to run a program in the background of a remote server. I wish
to
use ssh to do it. My first try was:
% ssh server \( program \& \)
It didn't work, ssh would hang. So I tried ssh with the -n option:
% ssh -n server \( program \& \)
It didn't work either. How should I fix that? Isn't there a way for
asking openssh not to wait for output of the program? Maybe I'm
missing
something on the manpage, but I got nothing :(.
[]'s
Rafael
"When the only tool you have is a hammer and the
hammer isn't working, make a trip to the toolsmithing
shop."
I write a script on the target host. That script is written
as if it were run by cron without PATH settings, with
IO redirection and so on.
Then I write a small driver script on the target host. All
it does is use nohup to launch the first script in
background then do something sensible about the
"nohup.out" file like change its name over the top of the
previous one so they don't grow without bounds.
Then I use ssh to launch that driver script.
On the other hand - Any chance the program is a network
service? Add it to /etc/inetd.conf or your flavor of UNIX's
equivalent. Better to launch automatically than to have
some other host get no-password permission to do it.
ssh server 'program </dev/null >/dev/null 2>&1 &'
--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***