Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Slightly OT: SSH not shutting down automatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slightly OT: SSH not shutting down automatically



Okay, I got it solved. If you bury stdout and stderr in /dev/null (rather than have them inherited from the master application), then ssh will quit normally. Apologies for the noise.

Brendan Younger

On Nov 8, 2004, at 4:05 PM, Brendan Younger wrote:

On Nov 8, 2004, at 2:52 PM, Tom Pollard wrote:

On Mon, 8 Nov 2004, Brendan Younger wrote:
I'm having problems getting SSH to quit automatically when the command
it's executing exits. Specifically, this is what's going on,


1. my application runs a shell script
2. the shell script runs "ssh -q -f user@host command"
3. the shell script exits (ssh and the remote command are still running)
4. my application exits (ssh session and remote command are still
running)
5. the remote command exits
6. ssh does NOT exit, but just stays open forever until I kill it
manually


How can I get ssh to exit? Running the "ssh -q -f user@host command"
incantation from the command line works as expected, ssh dies after the
remote command does.

Try using

    ssh -n -q -f user@host command

in your shell script.  If you don't use '-n' to shut off stdin when
executing a backgrounded ssh command, ssh can hang.  (See the ssh man
page).

Unfortunately, that didn't work. Anyone have any other ideas?

_______________________________________________ Do not post admin requests to the list. They will be ignored. Scitech mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Slightly OT: SSH not shutting down automatically (From: Tom Pollard <email@hidden>)
 >Re: Slightly OT: SSH not shutting down automatically (From: Brendan Younger <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.