Bitcoin Forum
June 17, 2024, 06:44:07 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: « 1 ... 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 [5109] 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 ... 7012 »
  Print  
Author Topic: [ANN][DASH] Dash (dash.org) | First Self-Funding Self-Governing Crypto Currency  (Read 9722675 times)
Solarminer
Hero Member
*****
Offline Offline

Activity: 826
Merit: 502


View Profile
August 26, 2015, 11:19:46 PM
Last edit: August 26, 2015, 11:35:10 PM by Solarminer

How to start dashd automatically again after it crashed.

run:
Code:
crontab -e 

add line:
Code:
*/1 * * * * /home/dashuser/mn_watch.sh >/dev/null 2>&1

use any editor you like and save this as "mn_watch.sh" file in user "dashuser" home directory:
Code:
#!/bin/bash
if [ -z `pidof dashd` ]; then
/home/dashuser/dashd
fi

add executable flag:
Code:
chmod u+x mn_watch.sh


PS. Use appropriate username, not "dashuser" from my example Wink
I also assumed that dashd is located in your user home directory, change path if needed.

PPS. not tested but should work  Roll Eyes

EDIT: ooops, tested and fixed  Smiley

This seems like the perfect solution to my all of my MN problems, But I am 5 and dont understand this, tryed but did not work, Can someone make a video for 5y olds Tongue

Putting a 10 dash bounty on this  Cool .. if anyone is interested Grin

(send me a priv message if you want to collect the bounty, I rarely scan every page here)

No offense, but that's as easy as it gets. The only substitute is using whatever text editor you have on your instance to actually create the script file (vi, nano, joe, etc).
Actually, crontabs may require a restart or server reboot.  Might also need to run with sudo crontab -e if running server as root.  A server I rented didn't have crontab installed so this isn't always a no brainer.

Icebucket, try this:
Copy code below and paste into mn_watch.sh file.  Type nano mn_watch.sh, paste with right click, and control x, y, enter to save.  Change dashuser to your user name.
Code:
#!/bin/bash
#run with:  screen -dm /mn_watch.sh
#stop with:  screen -ls to find number and screen -X -S 11111 kill
while true; do
if [ -z `pidof dashd` ]; then
echo Dashd is not running trying to start
/home/dashuser/dashd
sleep 600
else
echo Dashd is Running
sleep 600
fi
done

type:
chmod +x mn_watch.sh

You can test it by running:
./mn_watch.sh
It will stop working as soon as you logout though, so we need to install screen to have it run in the background.  Run this to install screen.  (Assuming you are running Ubuntu.)
apt-get install screen

to start with  screen type:
screen -dm /mn_watch.sh

This will run forever, so if you want it to stop type
screen -ls and get the number replace that with the 11111 below.
screen -X -S 11111 kill

I set this up to run every 10 minutes, just because it will be a pain if you are updating and every minute it tries to restart dashd.  If you want to run with UdjinM6's suggestion with the crontab start with a */10 for 10 minutes so you don't have to stop the crontab everytime you update your node.
oaxaca
Hero Member
*****
Offline Offline

Activity: 671
Merit: 500


View Profile
August 26, 2015, 11:33:37 PM

..A server I rented didn't have crontab installed so this isn't always a no brainer...

If you don't have crontab installed, try this:

Code:
apt-get update
apt-get upgrade
apt-get install cron
Solarminer
Hero Member
*****
Offline Offline

Activity: 826
Merit: 502


View Profile
August 26, 2015, 11:41:54 PM

..A server I rented didn't have crontab installed so this isn't always a no brainer...

If you don't have crontab installed, try this:

Code:
apt-get update
apt-get upgrade
apt-get install cron
Then you need to reboot for the cron process to take effect.
Add your crontab with crontab -e or sudo crontab -e
Then activate your crontab.  I think sudo service cron restart

Then to stop you need to edit the crontab and then restart the cron service.  Seems more complicated to me.
UdjinM6
Legendary
*
Offline Offline

Activity: 1318
Merit: 1040



View Profile WWW
August 26, 2015, 11:51:22 PM

.......
Actually, crontabs may require a restart or server reboot.  Might also need to run with sudo crontab -e if running server as root.

..A server I rented didn't have crontab installed so this isn't always a no brainer...

If you don't have crontab installed, try this:

Code:
apt-get update
apt-get upgrade
apt-get install cron
Then you need to reboot for the cron process to take effect.
Add your crontab with crontab -e or sudo crontab -e
Then activate your crontab.  I think sudo service cron restart

Then to stop you need to edit the crontab and then restart the cron service.  Seems more complicated to me.

I don't think so  Roll Eyes

Code:
man crontab
Quote
...
       crontab  is  the  program used to install, deinstall or list the tables used to drive the cron( 8 ) daemon in Vixie Cron.  Each user can have their own crontab, and
       though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly.
...
       For standard Debian systems, all users may use this command.
...

Code:
man cron
Quote
...
       cron searches its spool area (/var/spool/cron/crontabs) for crontab files (which are named after accounts in /etc/passwd); crontabs found are loaded into  memory.
...
       cron  then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute.
...
       Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on the /etc/crontab file) has changed, and if it has, cron will then
       examine the modtime on all crontabs files and reload those which have changed.  Thus cron need not be restarted whenever a crontab file is  modified.   Note  that
       the crontab(1) command updates the modtime of the spool directory whenever it changes a crontab.
...

DASH: XsV4GHVKGTjQFvwB7c6mYsGV3Mxf7iser6
tungfa
Legendary
*
Offline Offline

Activity: 1834
Merit: 1023


View Profile
August 27, 2015, 12:30:51 AM

Kudos to jamie and the family
(no Dash)
http://motherboard.vice.com/read/meet-the-bitcoin-family?utm_source=mbfb

"When Jamie Redman’s six-year-old son Joshua loses a tooth, he wakes up to a paper QR code linking to a Bitcoin wallet stuffed under his pillow."
Solarminer
Hero Member
*****
Offline Offline

Activity: 826
Merit: 502


View Profile
August 27, 2015, 01:21:46 AM

.......
Actually, crontabs may require a restart or server reboot.  Might also need to run with sudo crontab -e if running server as root.

..A server I rented didn't have crontab installed so this isn't always a no brainer...

If you don't have crontab installed, try this:

Code:
apt-get update
apt-get upgrade
apt-get install cron
Then you need to reboot for the cron process to take effect.
Add your crontab with crontab -e or sudo crontab -e
Then activate your crontab.  I think sudo service cron restart

Then to stop you need to edit the crontab and then restart the cron service.  Seems more complicated to me.

I don't think so  Roll Eyes

Code:
man crontab
snip
UdjinM6, I do believe the crontab method is indeed the most stable way of doing this and this should work.  I am probably thinking this is harder than it is. But I have struggled in the past to get permissions of the crontab user, file permissions, and directory just right so everything runs.  Just trying to save someone else a little of that time I wasted... 
HinnomTX
Hero Member
*****
Offline Offline

Activity: 525
Merit: 500



View Profile
August 27, 2015, 02:29:46 AM

I've upgraded my masternodes to v12.0.49 but I'm still seeing some of them drop off the list after 1-2 hours as EXPIRED. It's strange because the 'expired' masternodes are still active with port open (responding to 'dash-cli getinfo'). Anyone else having this problem?

50% of the time is because you execute the "masternode startt "xxx"" from the cold wallet that is not on the last version.
Aha! I think this was my problem. The cold daemon was still on v12.0.46. Testing now, hopefully they'll stick. Thanks.

"One can only solve so much with cryptography. The rest of the solution will prove to be economic in nature." -Evan Duffield
Dash is Digital Cash.  https://www.dash.org
Icebucket
Sr. Member
****
Offline Offline

Activity: 409
Merit: 250


View Profile
August 27, 2015, 03:33:43 AM

.......
Actually, crontabs may require a restart or server reboot.  Might also need to run with sudo crontab -e if running server as root.

..A server I rented didn't have crontab installed so this isn't always a no brainer...

If you don't have crontab installed, try this:

Code:
apt-get update
apt-get upgrade
apt-get install cron
Then you need to reboot for the cron process to take effect.
Add your crontab with crontab -e or sudo crontab -e
Then activate your crontab.  I think sudo service cron restart

Then to stop you need to edit the crontab and then restart the cron service.  Seems more complicated to me.

I don't think so  Roll Eyes

Code:
man crontab
snip
UdjinM6, I do believe the crontab method is indeed the most stable way of doing this and this should work.  I am probably thinking this is harder than it is. But I have struggled in the past to get permissions of the crontab user, file permissions, and directory just right so everything runs.  Just trying to save someone else a little of that time I wasted... 
Thanks so much guys, will try this out after some good night sleep. Im shure this will work out just fine ... after I have had my cup of coffie Cheesy

“Every morning we are born again. What we do today is what matters most.”
― Gautama Buddha
TanteStefana2
Legendary
*
Offline Offline

Activity: 1260
Merit: 1001


View Profile
August 27, 2015, 03:36:11 AM

How to start dashd automatically again after it crashed.

run:
Code:
crontab -e 

add line:
Code:
*/1 * * * * /home/dashuser/mn_watch.sh >/dev/null 2>&1

use any editor you like and save this as "mn_watch.sh" file in user "dashuser" home directory:
Code:
#!/bin/bash
if [ -z `pidof dashd` ]; then
/home/dashuser/dashd
fi

add executable flag:
Code:
chmod u+x mn_watch.sh


PS. Use appropriate username, not "dashuser" from my example Wink
I also assumed that dashd is located in your user home directory, change path if needed.

PPS. not tested but should work  Roll Eyes

EDIT: ooops, tested and fixed  Smiley

I have an existential crisis with this.  If the daemon should stop but nobody is around to witness it, did it really stop?  How will we ever know?

Another proud lifetime Dash Foundation member Smiley My TanteStefana account was hacked, Beware trading
"You'll never reach your destination if you stop to throw stones at every dog that barks."
Sir Winston Churchill  BTC: 12pu5nMDPEyUGu3HTbnUB5zY5RG65EQE5d
UdjinM6
Legendary
*
Offline Offline

Activity: 1318
Merit: 1040



View Profile WWW
August 27, 2015, 03:42:22 AM


I don't think so  Roll Eyes

Code:
man crontab
snip
UdjinM6, I do believe the crontab method is indeed the most stable way of doing this and this should work.  I am probably thinking this is harder than it is. But I have struggled in the past to get permissions of the crontab user, file permissions, and directory just right so everything runs.  Just trying to save someone else a little of that time I wasted...  

No problems at all doing it in another way.  Smiley
I didn't mean to force everyone to use my script, it was just few statements in your post that doesn't feel like they are 100% correct  Roll Eyes
But yeah, there are multiple ways to achive the same result and there could be some unexpected troubles using either method.

EDIT: so, once again, no troubles and thank you for providing alternative version that worked for you.  Smiley

DASH: XsV4GHVKGTjQFvwB7c6mYsGV3Mxf7iser6
UdjinM6
Legendary
*
Offline Offline

Activity: 1318
Merit: 1040



View Profile WWW
August 27, 2015, 03:49:32 AM
Last edit: August 27, 2015, 01:35:08 PM by UdjinM6

Our build system now produce linux files that are not recognized by Ubuntu file explorer as executables though they are.
I wrote yet another simple script  Grin to install dash-qt from downloaded archive and to give it a nice icon.
Here is what you need to do:

1) After you extracted downloaded archive you should have dash-0.12.0 folder somewhere.
Go inside it, create a file named install_dash_qt.sh and edit it with your favorite editor:

Code:
#!/bin/bash
sudo -s install -m 0755 -o root -g root -t /usr/local/bin bin/dash-qt
echo "[Desktop Entry]
Name=Dash-Qt
Comment=Dash - Reinventing Cryptocurrency https://www.dashpay.io
Type=Application
Exec=dash-qt %u
Terminal=false
Icon=/usr/share/pixmaps/dash128.xpm
MimeType=x-scheme-handler/dash
Categories=Applications;Finance;" > ~/Desktop/Dash-Qt.desktop
chmod u+x ~/Desktop/Dash-Qt.desktop
sudo cp ~/Desktop/Dash-Qt.desktop /usr/share/applications/
sudo wget -O /usr/share/pixmaps/dash128.xpm https://github.com/dashpay/dash/raw/master/share/pixmaps/bitcoin128.xpm

2) Right click on empty space in that folder and choose "Open in Terminal". In command line issue:
Code:
chmod u+x install_dash_qt.sh
to make file executable and
Code:
./install_dash_qt.sh
to run it.

Enter your password and shortly after you should have a nice icon on your Desktop and the same icon in Applications.

Enjoy! Smiley

PS. This script reguires wget. Install it first if you don't have it already
Code:
sudo apt-get install wget

EDIT:
"su -c" requires you to set root password which "normal"/non-developer users do not have at all (by ubuntu's default)
Changed script to use "sudo -s" instead, give it a try if you had problems before

DASH: XsV4GHVKGTjQFvwB7c6mYsGV3Mxf7iser6
snogcel
Full Member
***
Offline Offline

Activity: 194
Merit: 100


View Profile
August 27, 2015, 04:00:28 AM

Our build system now produce linux files that are not recognized by Ubuntu file explorer as executables though they are.
I wrote yet another simple script  Grin to install dash-qt from downloaded archive and to give it a nice icon.
Here is what you need to do:

1) After you extracted downloaded archive you should have dash-0.12.0 folder somewhere.
Go inside it, create a file named install_dash_qt.sh and edit it with your favorite editor:

Code:
#!/bin/bash
su -c 'install -m 0755 -o root -g root -t /usr/local/bin bin/dash-qt'
echo "[Desktop Entry]
Name=Dash-Qt
Comment=Dash - Reinventing Cryptocurrency https://www.dashpay.io
Type=Application
Exec=dash-qt %u
Terminal=false
Icon=/usr/share/pixmaps/dash128.xpm
MimeType=x-scheme-handler/dash
Categories=Applications;Finance;" > ~/Desktop/Dash-Qt.desktop
chmod u+x ~/Desktop/Dash-Qt.desktop
sudo cp ~/Desktop/Dash-Qt.desktop /usr/share/applications/
sudo wget -O /usr/share/pixmaps/dash128.xpm https://github.com/dashpay/dash/raw/master/share/pixmaps/bitcoin128.xpm

2) Right click on empty space in that folder and choose "Open in Terminal". In command line issue:
Code:
chmod u+x install_dash_qt.sh
to make file executable and
Code:
./install_dash_qt.sh
to run it.

Enter your password and shortly after you should have a nice icon on your Desktop and the same icon in Applications.

Enjoy! Smiley

PS. This script reguires wget. Install it first if you don't have it already
Code:
sudo apt-get install wget

Nice! That worked like a charm

XuvjV4aazgZhcfAj1KRgFnTok1pZZw6Ewu
Bridgewater
Full Member
***
Offline Offline

Activity: 133
Merit: 100


View Profile
August 27, 2015, 05:35:24 AM

I set this up to run every 10 minutes, just because it will be a pain if you are updating and every minute it tries to restart dashd.  If you want to run with UdjinM6's suggestion with the crontab start with a */10 for 10 minutes so you don't have to stop the crontab everytime you update your node.

Why not just put "rm dashd" as the first line of your update script?  Basically pull the rug out from under the crontab, so that it will not be able to start up again while you're in the process of updating.  Once you've put an (updated) dashd back in the same spot, the crontab should continue to work its magic as usual.
moocowmoo
Sr. Member
****
Offline Offline

Activity: 263
Merit: 250


bovine quadruped, professional loafer, dash dev


View Profile WWW
August 27, 2015, 05:43:05 AM

Update script updated (through the power of scripting!)

UPDATES
  • Will now attempt to locate where you've installed your dashd/dash-cli
  • Shows pretty output of what its done (and where it's done it!)
BUGS
  • Probably
  • Still only works on Linuxes
  • Still can't deliver beers on demand
  • Others you haven't told me about yet



get it at https://github.com/moocowmoo/dashman

And let me know if you run into trouble!


tips: XmoocowYfrPKUR6p6M5aJZdVntQe71irCX | identity: https://keybase.io/moocowmoo
service: https://masternode.me -- The first automated masternode service. Ugly website, stellar uptimes and hands-on support. Over 150 nodes with 300+ days uptime!
Solarminer
Hero Member
*****
Offline Offline

Activity: 826
Merit: 502


View Profile
August 27, 2015, 05:58:59 AM

I set this up to run every 10 minutes, just because it will be a pain if you are updating and every minute it tries to restart dashd.  If you want to run with UdjinM6's suggestion with the crontab start with a */10 for 10 minutes so you don't have to stop the crontab everytime you update your node.

Why not just put "rm dashd" as the first line of your update script?  Basically pull the rug out from under the crontab, so that it will not be able to start up again while you're in the process of updating.  Once you've put an (updated) dashd back in the same spot, the crontab should continue to work its magic as usual.
The questions are: How long does it take to shutdown dashd? and How fast can you remove the dashd after it is shutdown?  If it takes 30 seconds you have a 50/50 shot with a 1 minute restart.  I think we do have about an hour that you can be down before you have to to a local start.  So every 10 minutes isn't really a big deal.
moocowmoo
Sr. Member
****
Offline Offline

Activity: 263
Merit: 250


bovine quadruped, professional loafer, dash dev


View Profile WWW
August 27, 2015, 06:53:59 AM

I set this up to run every 10 minutes, just because it will be a pain if you are updating and every minute it tries to restart dashd.  If you want to run with UdjinM6's suggestion with the crontab start with a */10 for 10 minutes so you don't have to stop the crontab everytime you update your node.

Why not just put "rm dashd" as the first line of your update script?  Basically pull the rug out from under the crontab, so that it will not be able to start up again while you're in the process of updating.  Once you've put an (updated) dashd back in the same spot, the crontab should continue to work its magic as usual.
The questions are: How long does it take to shutdown dashd? and How fast can you remove the dashd after it is shutdown?  If it takes 30 seconds you have a 50/50 shot with a 1 minute restart.  I think we do have about an hour that you can be down before you have to to a local start.  So every 10 minutes isn't really a big deal.

The best way to control dedicated cron jobs like this is through an intermediary file.

Code:
*/1 * * * *  [ -f /home/dashuser/.dash/dashd_enable ] && /home/dashuser/mn_watch.sh >/dev/null 2>&1

Then you can ignore cron and just do

Code:
touch ~/.dash/dashd_enable

to monitor/auto-restart and

Code:
rm ~/.dash/dashd_enable

when you want cron to keep its mitts off your procs.

--

Also, adding logging-on-action to mn_watch.sh and redirecting to a logfile is a good idea.  You want to know how often this happens.

Code:
#!/bin/bash
if [ -z `pidof dashd` ]; then
echo "$(date +%Y-%m-%d\ %H:%m:%S\ %Z) - restarting dashd"
/home/dashuser/dashd 2>&1 >/dev/null
fi

(dashd >/dev/null not a big deal, it has it's own logging)

then

Code:
*/1 * * * *  [ -f /home/dashuser/.dash/dashd_enable ] && /home/dashuser/mn_watch.sh >/home/dashuser/mn_watch.log 2>&1

tips: XmoocowYfrPKUR6p6M5aJZdVntQe71irCX | identity: https://keybase.io/moocowmoo
service: https://masternode.me -- The first automated masternode service. Ugly website, stellar uptimes and hands-on support. Over 150 nodes with 300+ days uptime!
Rux
Legendary
*
Offline Offline

Activity: 1291
Merit: 1024


https://crypto.ba


View Profile WWW
August 27, 2015, 06:59:19 AM

Guys if you continue like that... one day we will have Autoupdating, Autostarting, Autorestarting, self-sustainable MNs

Me like it Cheesy

RXC Crypto.ba Decentralized solutions!
Sub-Ether
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


Quantum entangled and jump drive assisted messages


View Profile
August 27, 2015, 07:07:24 AM

Never used them but some of you might,
http://www.econotimes.com/Australian-Bitcoin-Exchange-iGot-halts-trading-80723
and the leadup,
http://themerkle.com/fraud/igot-exchange-scam-the-worst-bitcoin-exchange-still-in-operation/
looks like you can still sign in.

Dash is 27.3 times faster with syncing and updating than Bitcoin and 93.7 times faster than Monero. Bitcoin (v0.11.0) has a Tao ratio 11.2% faster than bitcoin (v0.10.0) release.
Dash (v.0.12.0.49) = Tao sync ratio = 0.15 seconds / hour of update || Dash (v.0.11.2.23) = Tao sync ratio = 0.24 seconds / hour of update. V12 versus V11 speedup = +36.5%
Bitcoin (v.0.11.0) = Tao sync ratio = 4.14 seconds / hour of update || Monero (v.0.41.1)  = Tao sync ratio = 14.2 seconds / hour of update
moocowmoo
Sr. Member
****
Offline Offline

Activity: 263
Merit: 250


bovine quadruped, professional loafer, dash dev


View Profile WWW
August 27, 2015, 07:32:39 AM

Guys if you continue like that... one day we will have Autoupdating, Autostarting, Autorestarting, self-sustainable MNs

Me like it Cheesy


Nothing replaces having a full-time admin with a monitoring network. Wink

tips: XmoocowYfrPKUR6p6M5aJZdVntQe71irCX | identity: https://keybase.io/moocowmoo
service: https://masternode.me -- The first automated masternode service. Ugly website, stellar uptimes and hands-on support. Over 150 nodes with 300+ days uptime!
110110101
Legendary
*
Offline Offline

Activity: 1382
Merit: 1002



View Profile
August 27, 2015, 07:35:35 AM

....

Just wanted to give you a special thanks mate! Your scripts are going to be lifesavers for many happy masternode users Wink
Pages: « 1 ... 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 [5109] 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 ... 7012 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!