Re: when does ssh return?
Hello, Any process should wait() for all of its children to exit or the children will become a zombie process when they exit. This isn't a good thing. See wait() 2, and fork() 2 for more information. Regards, -- Jason Muskat | GCUX - de VE3TSJ TechDude e. [EMAIL PROTECTED] m. 416 .414 .9934 http://TechDude.Ca/ From: David Richardson [EMAIL PROTECTED] Date: Fri, 05 May 2006 16:03:39 -0400 To: secureshell@securityfocus.com Subject: when does ssh return? I've looked through ssh man page and FAQ and tried a google search, but can't seem to figure out how to use ssh to start a command on a remote machine, have ssh exit immediately, and still have the command running on the remote machine. When I do [popcorn][~]$ time ssh [EMAIL PROTECTED] sleep 10 real0m10.216s user0m0.060s sys 0m0.000s ssh waits for the sleep to finish. Does anyone either understand why ssh is waiting for sleep to finish or how to make it not do it? I've tried ssh [EMAIL PROTECTED] run_and_return sleep 10 where run_and_return is the bash script: #!/bin/bash ?@ and a similar thing with a perl script that forks. I even tried having the perl script fork, have its child fork, and then the grandchild execute the command. But ssh keeps sticking around... Thanks for any help, Dave p.s. I'm using [popcorn][~]$ ssh -V OpenSSH_3.5p1, SSH protocols 1.5/2.0, OpenSSL 0x0090701f on [popcorn][~]$ uname -a Linux popcorn 2.4.20-6 #1 Thu Feb 27 10:01:19 EST 2003 i686 athlon i386 GNU/Linux with Fedora Core 2 installed.
Re: when does ssh return?
On 2006-05-05 16:03:39 -0400, David Richardson wrote: I've looked through ssh man page and FAQ and tried a google search, but can't seem to figure out how to use ssh to start a command on a remote machine, have ssh exit immediately, and still have the command running on the remote machine. Does -f what you want? Best Martin -- http://www.tm.oneiros.de
Re: when does ssh return?
David Richardson wrote: I've looked through ssh man page and FAQ and tried a google search, but can't seem to figure out how to use ssh to start a command on a remote machine, have ssh exit immediately, and still have the command running on the remote machine. When I do [popcorn][~]$ time ssh [EMAIL PROTECTED] sleep 10 real0m10.216s user0m0.060s sys 0m0.000s ssh waits for the sleep to finish. Does anyone either understand why ssh is waiting for sleep to finish or how to make it not do it? I've tried ssh [EMAIL PROTECTED] run_and_return sleep 10 where run_and_return is the bash script: #!/bin/bash ?@ and a similar thing with a perl script that forks. I even tried having the perl script fork, have its child fork, and then the grandchild execute the command. But ssh keeps sticking around... Thanks for any help, Dave p.s. I'm using [popcorn][~]$ ssh -V OpenSSH_3.5p1, SSH protocols 1.5/2.0, OpenSSL 0x0090701f on [popcorn][~]$ uname -a Linux popcorn 2.4.20-6 #1 Thu Feb 27 10:01:19 EST 2003 i686 athlon i386 GNU/Linux with Fedora Core 2 installed. From the ssh man page: -f Requests ssh to go to background just before command execution. This is useful if ssh is going to ask for pass- words or passphrases, but the user wants it in the background. This implies -n. The recommended way to start X11 programs at a remote site is with something like ssh -f host xterm. -N Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only). -n Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background. A common trick is to use this to run X11 programs on a remote machine. For example, ssh -n shadows.cs.hut.fi emacs will start an emacs on shadows.cs.hut.fi, and the X11 connection will be automatically forwarded over an encrypted channel. The ssh program will be put in the background. (This does not work if ssh needs to ask for a password or passphrase; see also the -f option.) -- Giancarlo Razzolini Linux User 172199 Moleque Sem Conteudo Numero #002 Slackware Current OpenBSD Stable Snike Tecnologia em Informática 4386 2A6F FFD4 4D5F 5842 6EA0 7ABE BBAB 9C0E 6B85 signature.asc Description: OpenPGP digital signature
when does ssh return?
I've looked through ssh man page and FAQ and tried a google search, but can't seem to figure out how to use ssh to start a command on a remote machine, have ssh exit immediately, and still have the command running on the remote machine. When I do [popcorn][~]$ time ssh [EMAIL PROTECTED] sleep 10 real0m10.216s user0m0.060s sys 0m0.000s ssh waits for the sleep to finish. Does anyone either understand why ssh is waiting for sleep to finish or how to make it not do it? I've tried ssh [EMAIL PROTECTED] run_and_return sleep 10 where run_and_return is the bash script: #!/bin/bash ?@ and a similar thing with a perl script that forks. I even tried having the perl script fork, have its child fork, and then the grandchild execute the command. But ssh keeps sticking around... Thanks for any help, Dave p.s. I'm using [popcorn][~]$ ssh -V OpenSSH_3.5p1, SSH protocols 1.5/2.0, OpenSSL 0x0090701f on [popcorn][~]$ uname -a Linux popcorn 2.4.20-6 #1 Thu Feb 27 10:01:19 EST 2003 i686 athlon i386 GNU/Linux with Fedora Core 2 installed.