Title: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: 4019 on December 29, 2013, 08:06:17 PM Hi there. I've written DataMinerWatch as a solution for miner hangs during nighttime hours, when my PC have to operate autonomously, and recently decided to comment&clear the code and push it to Github (https://github.com/arkhebuz/datawatch). In this form script address three things:
Note that automatic pool switching on errors can save you from downtime caused by pool crash, as the second of two currently running Datacoin pools is in early beta stage and still a bit unstable. Quick how-to (If this post gets old and howto become broken, check github readme in case when I have updated something there but not here)
Quirks
Title: Re: [ANN] [DTC] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: maxsolnc on December 29, 2013, 10:53:25 PM Great work!
I've sent you some DTC as a tip. Let's wait for feedbacks from the community! Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: GreekBitcoin on January 07, 2014, 02:20:11 PM I have a few vps running. And sometimes i put more. So i need this cause half of them stop over night. But i am too noob of linux to understand how this work :P
I mean i cant edit. I tried vi the file but then i cant do anything else :P How do i edit? Btw i am using putty so i am always console mode. also: 1.Do i really have to change the catalog that this stores the log files? 2.What about the network interface... ??? i am confused ??? 3. 4. 5. How do i edit !? Thanks :) Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: 4019 on January 07, 2014, 06:39:59 PM Back online...
I mean i cant edit. I tried vi the file but then i cant do anything else :P How do i edit? Well, actually forcing linux noob to use vi is a well known method of generating random keystrokes (its a hermetic joke ;-).I'm advanced linux user, so I am able to close vi without that (its autoirony). Try to use nano editor (its actual advice). Should work nowdays (pros of vi is compability with every wickest console). 1.Do i really have to change the catalog that this stores the log files? Yes, unless patch /home/arkhebuz/datacoin exist on your system. If not, you will get only errors... You should store logs in a separate catalog for clarity.2.What about the network interface... ??? i am confused ??? You should have folder in /sys/class/net catalog, named like your network interface (using linux convention, look here for a second http://rhinoceros.hubpages.com/hub/Arch-Linux-Network-Setup-for-Beginners under "Available Network Interfaces"). There are all accesible network interfaces there in fact, loopback too. You can view them just using ls /sys/class/net (paste here the output if you still don't know wtf is this).3. 4. 5. How do i edit !? Have you ever looked at the code? I guess not, because changing sleeptime is very easy and intuitive I think... (Hint - there are important comments there too)However you might still have problems with 4&5, you need to edit in script everything what is NOT bolded here: ./primeminer -poolip=$ip -poolport=$port -poolshare=6 -pooluser=DMy7cMjzWycNUB4FWz2YJEmh8EET2XDvqz -genproclimit="8" -sievesize="1000000" -sieveextensions="10" -sievepercentage="9" 2>&1 | tee -a $logkat/$filename & ./primeminer is a binary location. If you have it under /home/greekbitcoin/datatacoin/primeminer, then paste there this patch. -poolshare=6 - no need to change with current pools. -pooluser=DMy7cMjzWycNUB4FWz2YJEmh8EET2XDvqz - set your own address, lets say xxxxxxxxxxxxxxxxxxxx. -genproclimit="8" - number of threads to use, lest say 2. -sievesize="1000000" -sieveextensions="10" -sievepercentage="9" - well, cut this three out :P So, you end up with: /home/greekbitcoin/datatacoin/primeminer -poolip=$ip -poolport=$port -poolshare=6 -pooluser=xxxxxxxxxxxxxxxxxxxx -genproclimit="2" 2>&1 | tee -a $logkat/$filename & (you can view sourcecode online: https://github.com/arkhebuz/datawatch/blob/master/datawatch.sh) Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: GreekBitcoin on January 08, 2014, 01:13:59 AM Yep i got it working :) Thank you very much! Not only this is very helpful but also it made me learn nano which i have never heard of and i needed! and a few more linux things :)
Lets see if it helps and mining will continue until tomorrow... Many thanks! Now i have to do it to the rest of my machines :P Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: 4019 on January 08, 2014, 08:06:12 AM I'm happy you got it working, but there one thing more you would want in your case scenario. Script will not start when vps will be for whaever reason restarted.*
You can try supervisor like below. I would be thankful if you would ping me back and tell if it's working (why? see *). # Instal the supervisor sudo apt-get install supervisor # Make a conffile sudo nano /etc/supervisor/conf.d/datacoin.conf # Paste there this, should work... Fat manual: http://supervisord.org/configuration.html#program-x-section-settings [program:datawatch] command=/patch/to/datawatch.sh pool mode stdout_logfile=NONE stderr_logfile=/patch/to/logs/catalog/%(program_name)s.log autorestart=true # Restart supervisor daemon sudo /etc/init.d/supervisor stop sudo /etc/init.d/supervisor start There will be one additional logfile with stderr as you see. Could be set to NONE too, but one more file containing eventual errors doesn't hurt (and might sometimes help). *It's a bug and feature BOTH. I mine with my pc only, as I don't have credit card/paypal/etc so I can't even try the free trials outthere, and if my pc goes down for whatever reason I want to inspect it manually, and for sure I don't want to automatically stress the machine (in case of cooling faillure for example). Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: GreekBitcoin on January 08, 2014, 03:18:35 PM I will try this today and i will tell you!
Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: GreekBitcoin on January 08, 2014, 05:34:43 PM I changed my pool from gpool to xpool today. And while all of my vps changed only one of them for some reason wont start mining prompting this error:
grep: /home/user/datawatch/logs/: Is a directory Edit: i rebooted and it now works. still i have tried what you said but i will. Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: 4019 on January 08, 2014, 08:17:36 PM I guess that you still had process named "primeminer" hidden somewhere in a background (yeach I know, it's better to use pid in script...). When you rebooted you simply killed it.
OK, will make bugfix for that (perfect moment, I have shitload of exams now). Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: extro24 on January 14, 2014, 07:06:12 PM Greek have you tried to run Midnight Commander (mc) in putty?
Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: GreekBitcoin on January 14, 2014, 07:25:59 PM Greek have you tried to run Midnight Commander (mc) in putty? No. What does it do? Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: extro24 on January 17, 2014, 08:59:51 AM It's a visual file manager (but using text). It shows all the files and directories in a directory. It has Edit file, View file etc. I've used it for years. I think you will find it interesting in a linux VPS instance.
http://en.wikipedia.org/wiki/Midnight_Commander Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: forevernoob on January 17, 2014, 06:07:25 PM So getting "Segmenation fault" is normal when mining Datacoin?
Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: GreekBitcoin on January 17, 2014, 06:59:16 PM So getting "Segmenation fault" is normal when mining Datacoin? when using primeminer. Use this and you will be okay! Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: forevernoob on January 17, 2014, 07:08:08 PM Seriously what a joke. If you want this coin to be something you better have a miner that doesn't crash.
Having a work around that is restarting the miner when it crashes is not OK. This should be fixed by developer of primecoin fork. Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: GreekBitcoin on January 17, 2014, 07:28:01 PM Seriously what a joke. If you want this coin to be something you better have a miner that doesn't crash. Having a work around that is restarting the miner when it crashes is not OK. This should be fixed by developer of primecoin fork. Go ahead and write a miner that doesnt crash for primecoin algo better than primeminer... Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: infofront on January 18, 2014, 05:21:42 AM jhprimeminer is much more stable.
I just got this script running though, and so far, so good. I haven't been able to get the logs working right. I don't think I'm saving them in the right directory, but I probably don't need to see them anyway. Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: 4019 on January 18, 2014, 09:34:37 AM So getting "Segmenation fault" is normal when mining Datacoin? From my experience segfaults aren't that often. I faced connection problms mainly, i.e. when primeminer is working and mining, but not sending shares to pool for some unknown to me reason (and here comes the DMW). I just got this script running though, and so far, so good. I haven't been able to get the logs working right. I don't think I'm saving them in the right directory, but I probably don't need to see them anyway. If you don't see any errors in the output, then the catalog with logs should exist somewhere (otherwise, invocated shell programs would be calling for nonexistent resource).Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: 4019 on January 25, 2014, 09:37:15 AM Xolokram updated his primeminer to 0.8 RC2 version, introducing (finnally!) -poolip2, -poolip3 & -exitondisc (http://www.peercointalk.org/index.php?topic=485.msg16501#msg16501) launch parameters. They are the only change in this release.
I noticed that few days ago and hoped to test it myself, but... preety much this two weeks finnaly came (http://www.quickmeme.com/img/56/5699737f1ceda38cd9050ce34194f4da5c58cb44ead6efe3fae079ad9a1c9978.jpg). Looking at beeeeer technical thread (http://www.peercointalk.org/index.php?topic=501.msg16830#msg16830) doesn't explain much. From Xolo's post: Quote ps. i'm working on a bigger update to remove/clean up the code to make the miner more lightweight, update to mikaelh's new version & improve the network code, but this is taking longer than i thought so i'll release this smaller update on the old version first I hope that build-in-fallback with improved networking will solve the issues I'm trying to solve with external script.Title: Re: [ANN] [Datacoin] DataMinerWatch – bash script for restarting Primeminer on hangs Post by: forevernoob on January 25, 2014, 01:14:41 PM Great news, let us know when you have tested it yourself.
|