Re: Using ssh remote for a nohup process

From: Derek Martin (code_at_pizzashack.org)
Date: 10/03/05

  • Next message: Darren Tucker: "Re: Problem compiling OpenSSH 4.2p1 on Tru64 UNIX 4.0F"
    Date: Mon, 3 Oct 2005 14:42:45 -0400
    To: Jim Horwath <jim.horwath@rcn.com>
    
    
    

    On Sun, Oct 02, 2005 at 09:58:58AM -0100, Jim Horwath wrote:
    > #!/usr/bin/ksh
    > 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
    you're doing.

    > 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
    
    



  • Next message: Darren Tucker: "Re: Problem compiling OpenSSH 4.2p1 on Tru64 UNIX 4.0F"

    Relevant Pages

    • Re: Right Justify A Column
      ... Within a shell script I have ... What can I do before I redirect it, ... length first, then an appropriate format.) ... the first column changes depending on the size of the files ...
      (comp.unix.shell)
    • redirection of standard output of a Python command to a Python variable
      ... I try to find a quick way to redirect the standard output of a Python ... foobar = fsock.read ...
      (comp.lang.python)
    • Re: shell programming - conditional redirect STDOUT
      ... shell programming - conditional redirect STDOUT ... of a shell script or program being called from another shell script, ... If you need to capture it or pipe it AND want to see it on screen too, ...
      (comp.unix.sco.misc)
    • Re: Right Justify A Column
      ... Within a shell script I have ... What can I do before I redirect it, ... length first, then an appropriate format.) ... the first column changes depending on the size of the files ...
      (comp.unix.shell)
    • Re: shell programming - conditional redirect STDOUT
      ... shell programming - conditional redirect STDOUT ... of a shell script or program being called from another shell script, ...
      (comp.unix.sco.misc)