- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ssh and nohup question
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
06-01-2006 04:37 AM
06-01-2006 04:37 AM
ssh and nohup question
ssh remote "/home/root/script.sh"
the shell script contain something like
nohup ./example &
the problem on the distant server, I have no response from the execution of the script.
And I'm waiting, waiting.
Have you an idea ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2006 04:58 AM
06-01-2006 04:58 AM
Re: ssh and nohup question
I did not test it, but you may try something like:
ssh remote "/home/root/script.sh;tail -f /home/root/nohup.out"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2006 05:06 AM
06-01-2006 05:06 AM
Re: ssh and nohup question
I wouldn't the output of the command.
Just the simple execution of the script, with no wait.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2006 05:12 AM
06-01-2006 05:12 AM
Re: ssh and nohup question
what output do you expect?
Try this script ~/bin/chkit:
#!/usr/bin/ksh
echo output $1
if [ $# -gt 0 ]
then sleep $1
else
nohup $0 15 >/tmp/tt$$ &
fi
echo fini $1
[ -s /tmp/tt$$ ] && cat /tmp/tt$$
Run
ssh hostname ~/bin/chkit
You won't see the output of the nohup process on the screen but in the file, since it is not ready at the time the 'cat' ist performed.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2006 05:18 AM
06-01-2006 05:18 AM
Re: ssh and nohup question
The problem is with the ssh command.
The ssh are waiting the end of nohup and backrgound command.
The ssh command never qive the hand, no answer.
I need to make ctrl c, to stop the command.
On the remote server, the scipt was successfuly executed but have sended no answer ssh father process.
I hope you have understand my problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2006 05:27 AM
06-01-2006 05:27 AM
Re: ssh and nohup question
or use nohup ssh remote "/home/root/script.sh"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2006 06:48 AM
06-01-2006 06:48 AM
Re: ssh and nohup question
please try uf ssh succesful in executing
ssh otherhost ls -x
If okay, try
ssh -n otherhost /home/root/script.sh
else
ssh -v otherhost ls -x
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2006 07:20 PM
06-01-2006 07:20 PM
Re: ssh and nohup question
But I need to press enter after the start of the process to go back to the shell.
The ssh command, is into a web page, so couldn't press enter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2006 12:54 AM
06-02-2006 12:54 AM
Re: ssh and nohup question
is there a difference when you do not a
nohup ./example &
but just a plain call to
./example
in "/home/root/script.sh"?
Is there the need to press return as well?
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2006 01:11 AM
06-02-2006 01:11 AM
Re: ssh and nohup question
The launch script was into php script.
the command line was
exec("ssh root@hostname /script.sh);
I've remplaced the exec command, with popen function.
And now it works fine.
Thank you all for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2006 01:12 AM
06-02-2006 01:12 AM