How to exit ssh

Hi,

I have a script that runs ssh to multiple systems. It does the folowing :
ssh -f -T server1 "/sbin/init.d/logsurfer newstart"

Running it using the -f option at least the prompt gets back, running it without the -f the prompt does not even show up. You have to press <Ctrl> + c to get the prompt back. However in both cases the remote command succeeded.
Using the -f option only keeps the processes running in the process table.

Adding an exit to the command also does not work, even adding the exit in the script didn't work.

Anyone a suggestion about how to start a process on the other machine and getting a normal exit ?
I don't like to have many processes running when they already finished their job.

Regs David

Hhhm, as no-one comes with an answer I'll give it myself :slight_smile:

No, there are multiple forums and I got this answer from another one :

The problem is that my script uses <STDIN> as it wanted a terminal allocation. It will now wait forever to finish. You can prevent this using at.

The solution has been as following :

ssh -f -T server1 "echo \"/sbin/init.d/logsurfer newstart\" | at now"

Nice to be the first to give an answer on your own question :smiley:

Regs David