Version 0.2
Dreamhost PS Rebooter is an open source tool that reboots your Dreamhost virtual private server at set times.
Rebooting a server cleans out all hanging processes and connections, doing this regularly can save memory usage and thus improve the performance and reduce the cost of your Dreamhost virtual private server.
Although a Dreamhost VPS runs on Linux which is inherently stable, there is always the chance that some processes related to applications that you have installed yourself are hanging. Using PsRebooter shouldn't of course stop you from fixing problems that you may encounter with certain scripts.
You will need an API key for the Dreamhost web panel.
You can get one here:
https://panel.dreamhost.com/?tree=home.api.
This API key needs to be allowed to access dreamhost_ps-reboot.
Proceed to download the PsRebooter script and the configuration file:
Place both of these files in the same directory, for example in a "bin" directory of any user on the private server you want to reboot at set times. To run the script from another machine see the section entitled "Tweaking" further down this page. Avoid placing this script in your cgi-bin directory or under your site's document root, it should not be accessible via your website.
You can install this script directly from the command line of your VPS:
mkdir ~/bin 2>/dev/null; cd ~/bin wget http://www.7is7.com/software/dreamhost/download/psrebooter.tar.gz tar -zxvf psrebooter.tar.gz
If you did not follow the procedure above, check that the permissions are
in order: psrebooter.pl must be executable and
psrebooter.conf only readable by the owner (or type:
chmod 700 psrebooter.pl; chmod 600 psrebooter.conf).
Note: Is it important that your configuration file is not readable by others at it contains your Dreamhost API key and may contain your Twitter or Identi.ca passwords.
Edit the configuration file filling in your Dreamhost webpanel username and API key. Optionally you can also set the userid and password for a Twitter or Identica account (see below for more about that).
$username = 'me@mysite.com'; $key = 'ABCDEFGHIKLM';
$microblog = 'Identica'; # 'Identica' or 'Twitter' $uname = 'my_server'; $pass = 'secret';
Finally to get everything running, you'll need to set up your crontab to run psrebooter.pl at the times you want to reboot your server (this example assumes the program is located in you "bin" directory and will reboot your server on the first Saturday of every month):
0 1 1-7 * 6 $HOME/bin/psrebooter.pl > /tmp/psrebooter_cron.log 2>&1
When upgrading from an older version, one generally only needs to
replace psrebooter.pl, as the configuration file can
stay the same. You can follow the procedure above but without replacing
your original psrebooter.conf file.
The instruction below will only extract the perl program from the tar-file after downloading it:
cd ~/bin wget http://www.7is7.com/software/dreamhost/download/psrebooter.tar.gz tar -zxvf psrebooter.tar.gz psrebooter.pl
PsRebooter should be able to determine the machine you want to manage automatically, if for some reason it doesn't you can manually set the 'ps' variable in the configuration file to indicate the correct machine.
$ps = 'ps0000';
Note that you can use this feature to reboot your machine from another machine.
You can follow reboots of your Dreamhost PS server via Twitter or Identica. The idea is simple, you create a Twitter or Identi.ca account for your Dreamhost PS and let PsRebooter update it. You then proceed to follow this account from your own Twitter or Identi.ca account. Each time the your Dreamhost PS is rebooted you'll see a tweet about it appear in your updates stream.
For my own server I've set both PsRebooter and the memory manager PsManager to tweet/dent their actions in a Twitter and Identi.ca account:
As of version 0.2 it is possible to define your own template for the tweet, by adding a line to the configuration file, for example:
$tweet_template = "{ps} rebooted at {time}";
Where:
{ps} = the name of your VPS
{time} = the time at which this change occurred
If you are using the Dreamhost PS Rebooter script, you may also be interested in using the Dreamhost PS Manager script, to automatically manage the memory allocated to your VPS: PsManager.
The PsRebooter program is released under an open source license (GNU-GPL v3), which means that you can use this script for free and make any modifications that you please. You are in no way dependent on the original author of this program for future maintenance and your right to use it never expires. The source code of the script is easily viewable (the script is written in perl), you can scrutinize it or have it scrutinized to convince yourself that it does what it says it does.
There is a Dreamhost forum thread for PsManager where you can also ask questions about PsRebooter. If you are using or want to use PsRebooter feel free to contact me by E-mail about any problems or suggestions. If you are using PsRebooter and want to be notified of important new releases, send me an E-mail and ask to be added to the list.
7is7.com | Software | Otto | Travel Stories | Countdown Clock | Firefox | StatEye
New | About | Contact | Connect | Friends | Promotions | Copyright | Advertise