BitShares Forum

Other => Graveyard => MemoryCoin => Topic started by: Delinquency on January 16, 2014, 02:42:03 am

Title: Debian Node Monitor Script (Keep your Listen [churn] Node running 24/7)
Post by: Delinquency on January 16, 2014, 02:42:03 am
This script was initially a solo miner, but I have converted it into an unbreakable node.

The auto restarter detects for an unresponsive daemon mainly by checking the size of the debug log.
It is also designed to backup the wallet twice in UNIXTIME-backup.wallet.dat in the root folder.

If the server is detected unresponsive on several occasions (4 crashes within the 20 second checks), the script will automatically clear the block database. If any more (10 crashes in 20 second checks), the entire .memorycoin and memorycoin/ folder will be deleted (wallet.dat is always preserved) and then completely rebuilt from source.

You may play around with the variables in the beginning of the file on line 2 and on line 454 of the script. I suggest you just keep them at default values.

Tips @ MBCtHCXoKthgjdau4zpny9nCyNcJ4jTBG8

Install:
Quote
cd ~;wget https://dl.dropboxusercontent.com/u/50880632/mmc-churn-node.sh;chmod +x mmc-churn-node.sh; ./mmc-churn-node.sh

BROWSE THE SOURCE:
Code: [Select]
https://dl.dropboxusercontent.com/u/50880632/mmc-churn-node.sh
There may be an issue if you lost the session and then the script would then enter an infinite loop. It would also take 100% CPU. I set a trap to prevent the user from accidentally closing the script. All you have to do is close the script with 'kill -9 mmc-churn-node.sh'; The other option is to use a screen and then detach/attach it.

This script runs on my churn node at 69.197.161.42:1968, also listed on http://www.mmc-chain.com/?engine=nodeexplorer
Title: Re: Debian Node Monitor Script (Keep your Listen [churn] Node running 24/7)
Post by: Delinquency on January 29, 2014, 02:31:31 pm
Updated the script;
Tested on Debian 7 64-bit.

Installation runs a bit faster, automatically detects if the directories are there to work with and will ask you if they are incorrect.

The autorestarter cycler has been more fine tuned to test for crashes in 3, 45 second checks.
Limited connection limits between 25 to 700.
Fixed churn dialogue

A bit more improvements that are too small to notice.
thoughts, suggestions?

Fixed RPCPASSWORD ERROR by using 
Code: [Select]
echo ` < /dev/urandom tr -dc A-Za-z0-9 | head -c20` as the password.
Quote
https://snipt.net/johnvh/bash-random-string-generation/


Also set memorycoin.conf to be chmod 400'd.