In the RightScale Dashboard, you can manually reboot an active server by selecting Reboot from the More actions drop-down (ServerName > More actions > Reboot). In order for your servers to reboot properly, you need to make sure that your scripts are configured correctly. We are working hard to make sure that all of our RightScripts are reboot-safe. However, you are responsible for ensuring that your own custom scripts are reboot-safe. Follow the instructions below to make sure that your own RightScripts reboot-safe.
As you can see, there are several details associated with performing a successful reboot.
To help you make sure that your RightScripts are reboot-safe, we've provided a template below that you can follow as an example.
#!/bin/bash # # Description: # # Simple BASH RightScript that skips a portion of the code on REBOOT # # # This code runs each time the server Boots or REBOOTS # set # Display all of the Environment Variables to the Audit file # # Test for a reboot, if this is a reboot just skip this script. # if test "$RS_REBOOT" = "true" ; then echo "Skip Example script on reboot." logger -t ExampleScript "Skip Example script on reboot." exit 0 # Leave with a smile ... fi # # This portion of the RightScript runs only on first Launch boot. # date echo "This server just launched for the first time" logger -t ExampleScript "This server just launched for the first time" exit 0 # Leave with a smile...
Now we'll explain all of the features of this script above:
if test "$RS_REBOOT" = "true" ; then echo "Skip Example script on reboot." logger -t ExampleScript "Skip Example script on reboot." exit 0 # Leave with a smile ... fi
logger -t Example "your text here"
exit 0 # Leave with a smile...
In your ruby scripts, the following example will provide a way to skip code that should not be done on reboot.
if ENV['RS_REBOOT'] == 'true' system("logger -t ExampleScript Skipping Yada yada yada.") exit(0) # Leave with a smile ... end
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.