Re: Using ssh remote for a nohup process
From: Derek Martin (code_at_pizzashack.org)
Date: Mon, 3 Oct 2005 14:42:45 -0400 To: Jim Horwath <email@example.com>
On Sun, Oct 02, 2005 at 09:58:58AM -0100, Jim Horwath wrote:
> cd /dir/bin
> nohup ./foobar arg1 arg2 arg3 &
> echo $! > /dir/dir1/proc.pid
> exit 0
> On machine a I am doing
> ssh machineb "sudo -u daemon_user /dir/bin/foobar.sh "
> The sudo command works without a password
That seems rather ill-advised, but I'll trust that you know what
> I test it locally on machine b. If I run the remote ssh command all
> output from the script on machine b is printed to my screen. It
> appears the ssh/sudo combination is ignoring the nohup and &.
That may not be the case, and seems rather unlikely. So, what you're
complaining about is the output to your terminal, correct?
One possibility is that foobar may be writing directly to your
terminal, rather than STDOUT. If so, nohup won't help you here. It
may still be possible to redirect that output somewhere, but I don't
have time to explain how, so first figure out if that is what is going
on. If so, I'll explain later, after you reply.
If foobar is a shell script, look for it to be sending output to
/dev/tty, or some other redirection. If it isn't, then either you'll
need to supply more info, or you're on your own.
-- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0x81CFE75D
- application/pgp-signature attachment: stored