- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- ssh bash shell hangs...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 07:16 AM
10-27-2005 07:16 AM
I believe I found sort of a fix for this-
run the commands with this syntax:
some-command /dev/null 2>&1 &
Was just wondering if there was some ssh setting or some other way to prevent these hangs?
Thanks,
TJ
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 06:44 PM
10-27-2005 06:44 PM
Re: ssh bash shell hangs...
You can try adding nohup command:
# nohup some-command /dev/null 2>&1 &
maybe this helps.
Ciao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 08:43 PM
10-27-2005 08:43 PM
Re: ssh bash shell hangs...
can you explain what is the purpose of redirecting input "
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 10:19 PM
10-27-2005 10:19 PM
Solution- the process sshd has started (usually some sort of a shell) finishes
- no process is holding onto the standard input, output and error streams opened for the SSH session
- all X11 or TCP port forwarding connections are shut down, if any are used
When you want to use SSH to "launch" something on some remote host and leave it running there on its own, you must explicitly disconnect the launched process from the standard input, output and error streams so that sshd won't hold the connection open.
You *can* force the connection to shut down from the local side, but you must use SSH's escape characters for that. By default the key combination to disconnect is "~."
The "
The ">/dev/null 2>&1" is a shorthand for ">/dev/null 2>/dev/null" which redirects both the standard output (">") and standard error ("2>") streams to /dev/null aka the bit-bucket.
Depending on the features of the shell you're using, the final "&" may or may not be enough to leave the command running after the SSH connection closes. Some (most?) shells send a SIGHUP to any processes of the session left running when the session ends. To counteract that, you need to prefix your command with "nohup"... or detach the process from the session with "detach" if your shell supports that command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 10:43 PM
10-27-2005 10:43 PM
Re: ssh bash shell hangs...
I expect TJ to assign some points in my name (since I'm not the author of the thread).
Thanks to all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2005 12:58 AM
10-28-2005 12:58 AM