Re: starting remote server(s) with ssh

From: Robert Hajime Lanning (robert.lanning_at_gmail.com)
Date: 08/22/04

  • Next message: Roderick.Tapang_at_gxs.com: "RE: starting remote server(s) with ssh"
    Date: Sun, 22 Aug 2004 09:36:51 +0000
    To: secureshell@securityfocus.com
    
    

    You need to learn more about Unix shell and process control.
    ssh -n -x -l user host "nohup start_server.sh < /dev/null > /dev/null 2>&1 &"

    Either the server needs to properly run itself as a daemon. Which is
    to fork() itself
    into the background, close all TTYs (stdin, stdout, stderr), and make
    itself it's own
    process group leader. A process called "daemonizing".

    Or, you have to do what you can via the shell. "nohup" turns of the
    HUP signal, so
    when the shell exits and sends the HUP signal to all child processes, the server
    process will ignore it. Redirect stdin, stdout, stderr to/from
    /dev/null, kind of
    disassociates it from the terminal. Then put it in the background, so the shell
    can return.

    On Fri, 20 Aug 2004 21:35:54 -0700 (PDT), k l <yoda_2732002@yahoo.com> wrote:
    > Hi,
    >
    > How can I start a server on a remote
    > host and disconnect while
    > leaving the server running on the remote
    > machine?
    >
    > I am trying sth like:
    > ssh -n -x -l user host start_server.sh
    > (I've used ssh-agent and ssh-add to enter
    > my passphrase)
    >
    > The problem is that this keeps the ssh connection
    > open(with or without output from the remote server).
    > I would like to use this in a script which goes
    > through a list of hosts and starts a server on
    > each machine. I do not want to keep the ssh
    > connection open or in the background as the list
    > of remote hosts is fairly large.
    > I am using OpenSSH_3.6.1p2 on Enterprise RedHat Linux
    > v.3. This is probably a basic question that may
    > have been covered on the list but I could not find
    > an answer in the archives.
    >
    > Thank you for your help,
    >
    > kamen
    >
    >
    > _______________________________
    > Do you Yahoo!?
    > Win 1 of 4,000 free domain names from Yahoo! Enter now.
    > http://promotions.yahoo.com/goldrush
    >

    -- 
    END OF LINE
           -MCP
    

  • Next message: Roderick.Tapang_at_gxs.com: "RE: starting remote server(s) with ssh"

    Relevant Pages

    • Re: How do I use rsyncd.conf labels
      ... for the client (remote) machine to access such a "label"? ... The server can restrict ... one can configure the rsync ... daemon to 'chroot' to each path name during file transfer. ...
      (comp.os.linux.misc)
    • Re: Pine Server installation Recommendation
      ... who will give you a shell account with no bandwidth restrictions ... for much less money than getting a dedicated virtual server type deal. ... Provider 1 has a reasonable price, pine access via ssh but has only ... When you read the Infinite Ink Pine pages by Nancy (great pages Nancy, ...
      (comp.mail.pine)
    • Re: CGI apps in C?
      ... This would be used if you want to run "find" or some other shell ... server and settled on running PHP apps using fastcgi + suexec. ... Each user can then customise their config, ... information for each CGI execution. ...
      (freebsd-isp)
    • Re: Howto: ssh X11 display to Win2k
      ... It's just the standard X server. ... A shell springs to mind as a good start! ... >> you are sitting there typing at its shell prompt. ... you were so fantastically stupid as to not know how, ...
      (linux.redhat.misc)