Re: How to setup a ssh connection to a remote host while booting a linux system (executing an init-script) ?



Thomas Plaga@xxxxxxxxxxxxx wrote:
I have to kill processes on a slave server while shutdown the master,
and like to start these processes again while booting the master server again.

A sensible slave server process should react appropriately to the master going down by means of the protocol through which they communicate.

But in case you didn't write it, you could set up public key authentication with ssh. This means ssh can be ran non-interactively with:

ssh user@host command

How to do this is explained here under the part about "ssh-keygen":
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/openssh.html

Adding the aforementioned command to the shutdown scripts appropriate for your operating system[1] should allow you to remotely do stuff during shutdown.

[1] SSH has been ported to a plethora of operating systems and my cat is currently taking a nap on the crystal ball, so I can't make any guesses right now.
.