- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Writing a scritp to reboot a remote machine
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
Discussions
Discussions
Forums
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
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
тАО03-30-2006 10:11 PM
тАО03-30-2006 10:11 PM
I am writing a script to reboot a remote machine.
In that script, I am just copying another script (name Sreboot) having statement "reboot" to /etc/rc.config.d/ directory and then rebooting the machine.
When the remote machine is restarted again it again reboots because of Sreboot script.
This goes on.
Now I want to stop this.
I am trying to remove script "Sreboot" through ssh connection. but connection gets timed out. Is there any way to remove this file from directory /etc/rc.config.d/
I want to run this test many times. So, i donot want to go in maintianence mode and mannually remove it.
I want a way to remove this file from remote machine.
Can any one help? Is there any other way to do this?
Thanks in advance.
Prasad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 10:16 PM
тАО03-30-2006 10:16 PM
Re: Writing a scritp to reboot a remote machine
What is the content of Script Sreboot ?
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 10:21 PM
тАО03-30-2006 10:21 PM
Re: Writing a scritp to reboot a remote machine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 10:23 PM
тАО03-30-2006 10:23 PM
Re: Writing a scritp to reboot a remote machine
Get it to the remote system by GSP/MP, do a single user boot byt interupting the boot process. remove the file.
If you wanted to reboot a remote system, why can't you schedule it via cron.
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 10:24 PM
тАО03-30-2006 10:24 PM
Re: Writing a scritp to reboot a remote machine
#!/bin/csh
reboot &
Thanks for ur concern feedback
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 10:25 PM
тАО03-30-2006 10:25 PM
Re: Writing a scritp to reboot a remote machine
if reboot is what used said, then use my method to stop this. if you don't have GSP/MP, call someone in that data center or raise call with HP.
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 10:33 PM
тАО03-30-2006 10:33 PM
Re: Writing a scritp to reboot a remote machine
I do not want to mannually do it.
Consider there are 2 machines A and B
from B I am doing
# UpDown start A
this copies the script to /etc/rc.config.d/
then reboot machine A for first time
I am using ssh for this
Now machine A goes on rebooting
Now i want a way to do this
# UpDown stop A
this should remove the file from /etc/rc.config.d/
Thanks & reagards
Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 10:47 PM
тАО03-30-2006 10:47 PM
Re: Writing a scritp to reboot a remote machine
consider using ssh to remotely run the reboot (or shutdown) command. This is the most secure.
alternaltive: perl + telnet client.
I could provide you an example of this if needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 10:55 PM
тАО03-30-2006 10:55 PM
Re: Writing a scritp to reboot a remote machine
U r using ssl to reboot sys B from sys A,
instead of keeping ur script in /etc/rc.config.d keep it somewhere else. Since during execution of /sbin/rc all the files in
/etc/rc.config.d r executed to set the config.
variables. If u r placing ur script with a
reboot & command in it the system keeps rebooting.
If keeping system rebooting is not ur intension
then keep this script somewhere other than
/etc/rc.config.d (say /usr/sbin) , I usually
place it there only.
To get rid of repeatative rebooting u have to
get access of ISL of remote server, for this
as suggested by Chan u have to configure
GSM/MP, It is very useful to get it configured.
Through GSM u can boot into single user and remove the script
from /etc/rc.config.d
Hope it helps u.
Regards
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2006 11:41 PM
тАО03-30-2006 11:41 PM
Re: Writing a scritp to reboot a remote machine
I am unable to imagine what you are trying to achieve. If you want to reboot your remote machine just once why put script in /etc/rc.confg.d ??
Your local machine can execute a reboot command once through ssh whenever you wish to reboot the remote server.
Now the question remains is are you trying to break the reboot loop now so that you can login/use the remote server - if yes write a script on your local machine which will continuous ping the remote server and if able to reach the remote server run a ssh to replace the Sreboot script in /etc/rc.config.d in the remote server by a dummy script - this can be a blank file with the same name ie Sreboot.
while true
do
if [[ $(ping remote_server -n 2 | grep "%" | cut -f 1 -d "%" | awk '{print $NF}') = "0" ]]
then
sleep 5
fi
done
The reason I have kept the above script in loop is that even after you receive response to ping the other services for network may have not come up yet to eable you copying the file to remote server. Simultaneously you can check if the server has stopped rebooting - then you can interrupt this script on local server.
Then you can ammend what you were doing wrong.
Hope this helps,
Ninad