Solarminer
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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: add line: */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: #!/bin/bash if [ -z `pidof dashd` ]; then /home/dashuser/dashd fi
add executable flag: PS. Use appropriate username, not "dashuser" from my example ![Wink](https://bitcointalk.org/Smileys/default/wink.gif) I also assumed that dashd is located in your user home directory, change path if needed. PPS. not tested but should work ![Roll Eyes](https://bitcointalk.org/Smileys/default/rolleyes.gif) EDIT: ooops, tested and fixed ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) 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](https://bitcointalk.org/Smileys/default/tongue.gif) Putting a 10 dash bounty on this ![Cool](https://bitcointalk.org/Smileys/default/cool.gif) .. if anyone is interested ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) (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. #!/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
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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: apt-get update apt-get upgrade apt-get install cron
|
|
|
|
Solarminer
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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: 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
Activity: 1318
Merit: 1040
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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: 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](https://bitcointalk.org/Smileys/default/rolleyes.gif) ... 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. ...
... 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
|
|
|
|
Solarminer
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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: 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](https://bitcointalk.org/Smileys/default/rolleyes.gif) 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
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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: 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](https://bitcointalk.org/Smileys/default/rolleyes.gif) 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](https://bitcointalk.org/Smileys/default/cheesy.gif)
|
“Every morning we are born again. What we do today is what matters most.” ― Gautama Buddha
|
|
|
TanteStefana2
Legendary
Offline
Activity: 1260
Merit: 1001
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 27, 2015, 03:36:11 AM |
|
How to start dashd automatically again after it crashed. run: add line: */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: #!/bin/bash if [ -z `pidof dashd` ]; then /home/dashuser/dashd fi
add executable flag: PS. Use appropriate username, not "dashuser" from my example ![Wink](https://bitcointalk.org/Smileys/default/wink.gif) I also assumed that dashd is located in your user home directory, change path if needed. PPS. not tested but should work ![Roll Eyes](https://bitcointalk.org/Smileys/default/rolleyes.gif) EDIT: ooops, tested and fixed ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) 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](https://bitcointalk.org/Smileys/default/smiley.gif) 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
Activity: 1318
Merit: 1040
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 27, 2015, 03:42:22 AM |
|
I don't think so ![Roll Eyes](https://bitcointalk.org/Smileys/default/rolleyes.gif) 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](https://bitcointalk.org/Smileys/default/smiley.gif) 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](https://bitcointalk.org/Smileys/default/rolleyes.gif) 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](https://bitcointalk.org/Smileys/default/smiley.gif)
|
DASH: XsV4GHVKGTjQFvwB7c6mYsGV3Mxf7iser6
|
|
|
UdjinM6
Legendary
Offline
Activity: 1318
Merit: 1040
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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](https://bitcointalk.org/Smileys/default/grin.gif) 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: #!/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: chmod u+x install_dash_qt.sh to make file executable and 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](https://bitcointalk.org/Smileys/default/smiley.gif) PS. This script reguires wget. Install it first if you don't have it already 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
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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](https://bitcointalk.org/Smileys/default/grin.gif) 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: #!/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: chmod u+x install_dash_qt.sh to make file executable and 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](https://bitcointalk.org/Smileys/default/smiley.gif) PS. This script reguires wget. Install it first if you don't have it already sudo apt-get install wget Nice! That worked like a charm
|
XuvjV4aazgZhcfAj1KRgFnTok1pZZw6Ewu
|
|
|
Bridgewater
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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
![](https://ip.bitcointalk.org/?u=https%3A%2F%2Fraw.githubusercontent.com%2Fmoocowmoo%2Fdashman%2Fmaster%2Fscreencap.png&t=665&c=krcqKabjgAZ8hQ) get it at https://github.com/moocowmoo/dashmanAnd let me know if you run into trouble!
|
|
|
|
Solarminer
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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. */1 * * * * [ -f /home/dashuser/.dash/dashd_enable ] && /home/dashuser/mn_watch.sh >/dev/null 2>&1 Then you can ignore cron and just do touch ~/.dash/dashd_enable to monitor/auto-restart and 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. #!/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 */1 * * * * [ -f /home/dashuser/.dash/dashd_enable ] && /home/dashuser/mn_watch.sh >/home/dashuser/mn_watch.log 2>&1
|
|
|
|
Rux
Legendary
Offline
Activity: 1291
Merit: 1024
https://crypto.ba
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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](https://bitcointalk.org/Smileys/default/cheesy.gif)
|
RXC Crypto.ba Decentralized solutions!
|
|
|
Sub-Ether
Sr. Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 434
Merit: 250
Quantum entangled and jump drive assisted messages
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 27, 2015, 07:07:24 AM |
|
|
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
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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](https://bitcointalk.org/Smileys/default/cheesy.gif) Nothing replaces having a full-time admin with a monitoring network. ![Wink](https://bitcointalk.org/Smileys/default/wink.gif)
|
|
|
|
110110101
Legendary
Offline
Activity: 1382
Merit: 1002
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
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](https://bitcointalk.org/Smileys/default/wink.gif)
|
|
|
|
|