Have you checked out monit yet? I'm pretty sure it will do these things you want.<br><br>On Tuesday, June 17, 2014, Michael W. Hall <<a href="mailto:hallmw@att.net">hallmw@att.net</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That is what I was thinking.  I believe that it would just fire off a<br>
new copy bfgminer.  I mainly need to detect if a process called bfgminer<br>
is running.  If so, then just wait and check later.  If not, then start<br>
it again.<br>
<br>
I am not sure if this is feasible, but sometimes bfgminer will say a<br>
miner is dead if it has stopped responding.  I would like to restart<br>
bfgminer then also.  Not sure if you could detect that.  Anyone mining<br>
on the group?<br>
<br>
Michael<br>
<br>
On Mon, 2014-06-16 at 19:33 -0500, Paul F. Pearson wrote:<br>
> i didn't think of that. i'm not sure of the loop method was intended to run from cron. Of course you're right, if that was the intent.<br>
><br>
> ------<br>
> Paul F. Pearson<br>
> We all laugh in the same language<br>
><br>
> ----- Bob Nance <<a href="javascript:;" onclick="_e(event, 'cvml', 'bob.nance@novationsys.com')">bob.nance@novationsys.com</a>> wrote:<br>
> > Sorry, I was confused. I thought that was going to be a script called by cron. That would cause it to fork a new script every time cron was triggered which would fire off another miner on to of the one that was already there. My bad.<br>

> ><br>
> > ---<br>
> >  Bob Nance<br>
> >  Novation Systems<br>
> >  256-534-4620<br>
> ><br>
> > (iPhone-flavored)<br>
> ><br>
> ><br>
> > On Jun 16, 2014, at 4:20 PM, "Paul F. Pearson" <<a href="javascript:;" onclick="_e(event, 'cvml', 'pfpearson@mchsi.com')">pfpearson@mchsi.com</a>> wrote:<br>
> ><br>
> > >> Wouldn't that just stack the system with a new copy<br>
> > ><br>
> > > Only if bfgminer forks a new process then exits. Otherwise, the script will be blocked until bfgminer exits.<br>
> > ><br>
> > > Someone else suggeted using wait. That would be appropriate if the process runs in the background.<br>
> > ><br>
> > > Here's a few examples to demonstrate (I'll use a loop to answer the fear of "stacking the system"). In the first example, xclock will come up once; when you close it it will come up again in 10 seconds. You'll only see it 3 time. In the second example, xclock will come up three times 10 seconds apart. The third example will behave like the first.<br>

> > ><br>
> > > # Example 1: script will block until xclock exits<br>
> > > #!/bin/sh<br>
> > ><br>
> > > for i in 1 2 3; do<br>
> > >  xclock<br>
> > >  sleep 10<br>
> > > done<br>
> > ><br>
> > ><br>
> > > # Example 2: script will not block<br>
> > > #!/bin/sh<br>
> > ><br>
> > > for i in 1 2 3; do<br>
> > >  # run xlcok in the background; I think sh does this using a fork<br>
> > >  xclock &<br>
> > >  sleep 10<br>
> > > done<br>
> > ><br>
> > > # Example : script will block until xclock exits<br>
> > > #!/bin/sh<br>
> > ><br>
> > > for i in 1 2 3; do<br>
> > >  # run xlcok in the background; I think sh does this using a fork<br>
> > >  xclock &<br>
> > >  # now, wait for the xclock process to finish<br>
> > >  wait $!<br>
> > >  sleep 10<br>
> > > done<br>
> > ><br>
> > > Caveats: I only know what Michael said about bfgminer, so I can't say how it behaves. My brain isn't working well enough to use the right terminology about blocking, etc.<br>
> > ><br>
> > > ------<br>
> > > Paul F. Pearson<br>
> > > We all laugh in the same language<br>
> > ><br>
> > > ----- "Bob Nance" <<a href="javascript:;" onclick="_e(event, 'cvml', 'bob.nance@novationsys.com')">bob.nance@novationsys.com</a>> wrote:<br>
> > ><br>
> > >> Wouldn't that just stack the system with a new copy of the software<br>
> > >> running? Or is the software smart enough to not run twice?<br>
> > >><br>
> > >> ---<br>
> > >> Bob Nance<br>
> > >> Novation Systems<br>
> > >> 256-534-4620<br>
> > >><br>
> > >> (iPhone-flavored)<br>
> > >><br>
> > >><br>
> > >>> On Jun 13, 2014, at 8:40 PM, "John Price" <<a href="javascript:;" onclick="_e(event, 'cvml', 'jp_luna@gcfl.net')">jp_luna@gcfl.net</a>> wrote:<br>
> > >>><br>
> > >>> How about something much simpler...<br>
> > >>><br>
> > >>> #!/bin/sh<br>
> > >>> while /bin/true; do<br>
> > >>> bfgminer <various command line params><br>
> > >>> sleep 10 #wait a bit so if there's a real problem you don't hammer<br>
> > >> the<br>
> > >>> server<br>
> > >>> done<br>
> > >>><br>
> > >>><br>
> > >>><br>
> > >>>> On Fri, Jun 13, 2014 at 8:32 PM, Michael W. Hall <<a href="javascript:;" onclick="_e(event, 'cvml', 'hallmw@att.net')">hallmw@att.net</a>><br>
> > >> wrote:<br>
> > >>>><br>
> > >>>> Ok.  I have a question.  I am mining BTC.  Have been since<br>
> > >> February.  I<br>
> > >>>> am running bfgminer.  I have it running, but would like to improve<br>
> > >> it.<br>
> > >>>> When I am away from home (work or vacation), the bfgminer program<br>
> > >> will<br>
> > >>>> stop.<br>
> > >>>><br>
> > >>>> I know I can do it just not sure how to go about it.  I would like<br>
> > >> the<br>
> > >>>> system to check every 5 minutes or so if the bfgminer is running.<br>
> > >> If it<br>
> > >>>> is then do nothing.  If it is not then I would like to restart.  I<br>
> > >> have<br>
> > >>>> to start the program like so,<br>
> > >>>><br>
> > >>>> bfgminer <various command line params><br>
> > >>>><br>
> > >>>> Any ideas on the best way to do this?<br>
> > >>>><br>
> > >>>> Thanks,<br>
> > >>>> Michael<br>
> > >>>><br>
> > >>>> _______________________________________________<br>
> > >>>> LUNA mailing list<br>
> > >>>> <a href="javascript:;" onclick="_e(event, 'cvml', 'LUNA@lunagroup.us')">LUNA@lunagroup.us</a><br>
> > >>>> <a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank">http://lunagroup.us/mailman/listinfo/luna</a><br>
> > >>> -------------- next part --------------<br>
> > >>> An HTML attachment was scrubbed...<br>
> > >>> URL:<br>
> > >> <<a href="http://lunagroup.us/pipermail/luna/attachments/20140613/8f743ab7/attachment.html" target="_blank">http://lunagroup.us/pipermail/luna/attachments/20140613/8f743ab7/attachment.html</a>><br>

> > >>> _______________________________________________<br>
> > >>> LUNA mailing list<br>
> > >>> <a href="javascript:;" onclick="_e(event, 'cvml', 'LUNA@lunagroup.us')">LUNA@lunagroup.us</a><br>
> > >>> <a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank">http://lunagroup.us/mailman/listinfo/luna</a><br>
> > >> _______________________________________________<br>
> > >> LUNA mailing list<br>
> > >> <a href="javascript:;" onclick="_e(event, 'cvml', 'LUNA@lunagroup.us')">LUNA@lunagroup.us</a><br>
> > >> <a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank">http://lunagroup.us/mailman/listinfo/luna</a><br>
> > > _______________________________________________<br>
> > > LUNA mailing list<br>
> > > <a href="javascript:;" onclick="_e(event, 'cvml', 'LUNA@lunagroup.us')">LUNA@lunagroup.us</a><br>
> > > <a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank">http://lunagroup.us/mailman/listinfo/luna</a><br>
> > _______________________________________________<br>
> > LUNA mailing list<br>
> > <a href="javascript:;" onclick="_e(event, 'cvml', 'LUNA@lunagroup.us')">LUNA@lunagroup.us</a><br>
> > <a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank">http://lunagroup.us/mailman/listinfo/luna</a><br>
><br>
> _______________________________________________<br>
> LUNA mailing list<br>
> <a href="javascript:;" onclick="_e(event, 'cvml', 'LUNA@lunagroup.us')">LUNA@lunagroup.us</a><br>
> <a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank">http://lunagroup.us/mailman/listinfo/luna</a><br>
<br>
<br>
_______________________________________________<br>
LUNA mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'LUNA@lunagroup.us')">LUNA@lunagroup.us</a><br>
<a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank">http://lunagroup.us/mailman/listinfo/luna</a><br>
</blockquote>