Re: fork a background process und ssh

From: Nico Kadel-Garcia (nkadel@bellatlantic.net)
Date: 11/16/02


From: "Nico Kadel-Garcia" <nkadel@bellatlantic.net>
Date: Sat, 16 Nov 2002 05:21:52 GMT


"Jörg Schulz" <jschulz@sgbs.de> wrote in message
news:pan.2002.11.15.12.07.17.226856@sgbs.de...
> I want to to something like this:
>
> ssh host "/bin/process &"
>
> ssh should return immediately and the process should continue to run.
> All I get is that ssh either waits until the process has finished or
> it kills the process.

No, it shouldn't. You have dangling stdin, stdout, and stderr, which hold
open the ssh session lest they get cut off and oddnesses happen with the
dangling process on the server. Assuming that your shell is bash or sh, try
this instead:

    ssh host "/bin/process </dev/null 1>/dev/null 2>/dev/null &"



Relevant Pages

  • (Unix) Login with ssh ... TERM not set.
    ... The account on the target machine I ssh into has sh as a default shell. ... I prefer bash, but don't want to manually invoke 'bash' every time I log in, ...
    (comp.security.ssh)
  • Re: ssh + bash
    ... > I have a very simple question about ssh. ... > bash as my shell. ... When I log in to my account using ssh ...
    (comp.security.ssh)
  • Re: .bashrc not executed
    ... > On all my accounts, I have bash as my shell. ... When I use ssh ... but why bother since "man bash" has the explanation. ...
    (comp.security.ssh)
  • Re: Another variant of "ssh" working interactively, but "ssh cmd" and "scp" failing
    ... I've read the SSH and OpenSSH FAQ, ... PowerPC, the shell is a busybox, but using bash does not change ... ssh root@FOO ls -- fails, no output, no matter what command is given ...
    (comp.security.ssh)
  • ssh + bash
    ... I have a very simple question about ssh. ... bash as my shell. ... When I log in to my account using ssh ... I get bash, but neither .bash_profile nor .bashrc seem ...
    (comp.security.ssh)