HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Remote Script Execution with SSH
Operating System - HP-UX
1834394
Members
1456
Online
110066
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
08-07-2007 03:58 AM
08-07-2007 03:58 AM
I am trying to execute a java startup script remotely using ssh. Below is the script on the local server.
#!/usr/bin/sh
#cuss.test
ssh -lconnecto typhoon /home/connecto/CUSSTest/startup.sh
exit
Here is the remote script that starts the java process.
#!/usr/bin/sh
#startup.sh
cd /home/connecto/CUSSTest
CLASSPATH=$CLASSPATH:/home/connecto/CUSSTest
export CLASSPATH
nohup /opt/java1.5/bin/java CUSocketServer &
echo $! > ss.pid
exit
The remote script starts the java process and exits cleanly but the script on the local host is still running tailing the contents of the nohup.out file from the remote host. The script will not finish unitil the java process on the remote host is stopped. What needs to be done to make the script on the local host work independent of the startup.sh script on the remote host?
cirrus /usr/cuscripts #./cuss.test
Using /home/connecto/CUSSTest/settings.xml for configuration...
#!/usr/bin/sh
#cuss.test
ssh -lconnecto typhoon /home/connecto/CUSSTest/startup.sh
exit
Here is the remote script that starts the java process.
#!/usr/bin/sh
#startup.sh
cd /home/connecto/CUSSTest
CLASSPATH=$CLASSPATH:/home/connecto/CUSSTest
export CLASSPATH
nohup /opt/java1.5/bin/java CUSocketServer &
echo $! > ss.pid
exit
The remote script starts the java process and exits cleanly but the script on the local host is still running tailing the contents of the nohup.out file from the remote host. The script will not finish unitil the java process on the remote host is stopped. What needs to be done to make the script on the local host work independent of the startup.sh script on the remote host?
cirrus /usr/cuscripts #./cuss.test
Using /home/connecto/CUSSTest/settings.xml for configuration...
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2007 04:04 AM
08-07-2007 04:04 AM
Re: Remote Script Execution with SSH
Shalom,
Be default ssh does not read the complete environment on the target system. You will need to have your script read the profile and make sure the user environment on the remote system is the same as the local system.
SEP
Be default ssh does not read the complete environment on the target system. You will need to have your script read the profile and make sure the user environment on the remote system is the same as the local system.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2007 04:48 AM
08-07-2007 04:48 AM
Solution
Try this, instead of:
ssh -lconnecto typhoon /home/connecto/CUSSTest/startup.sh
use:
ssh -lconnecto typhoon /home/connecto/CUSSTest/startup.sh > /dev/null 2>&1 &
if that doesn't work try:
ssh -lconnecto typhoon /home/connecto/CUSSTest/startup.sh > /dev/null 2>&1 - &
ssh -lconnecto typhoon /home/connecto/CUSSTest/startup.sh
use:
ssh -lconnecto typhoon /home/connecto/CUSSTest/startup.sh > /dev/null 2>&1 &
if that doesn't work try:
ssh -lconnecto typhoon /home/connecto/CUSSTest/startup.sh > /dev/null 2>&1 - &
We are the people our parents warned us about --Jimmy Buffett
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP