PDA

View Full Version : Keeping the boinc client running on Windows



EmSti
05-25-12, 09:54 AM
I had been thinking about running Boinc as a service and using the recovery tab to restart the cllient if it stops. Been reading up on bonic as a service this morning and came across a few threads that indicate that running it as a service prevents it from seeing the GPUs.

I can think of a lot of options, like setting up a batch or perl program to start boinc everytime I login and restart it if it dies. But I thought I would check to see what the SETI.USA collective does. So,
1) Do you run boinc as a service (if so, any issues with GPU projects)?
2) What do you do to make sure boinc is running and restart if it crashes?

Slicker
05-25-12, 12:11 PM
BOINC runs fine as a service if and only if you do NOT do GPU crunching. Services aren't allowed access to the desktop any more which means no video access. If doing CPU only, it works fine. The benefit is that when run as a service, you don't have to log on to get it to run. It runs as soon as the machine is booted.

To monitor BOINC when running as a service, you use BOINC Manager, BOINC Tasks, BOINCView, etc. just as if it wasn't running as a service. To bounce the service, you go to adminstrative tools, serivces, and restart it (or stop and start). I believe that if you check the pop-up box at exit that says to shut down, it will stop the service, so you will either need to start the service again manually.

Tip of the day: Who says the command prompt is dead? You can type the commands far faster than you can drill down thru the menus and scroll through all the services. So, for those who aren't qwerty challenged, you can easily control the boinc service from a command prompt via "net start boinc" and "net stop boinc".

EmSti
05-25-12, 12:27 PM
DOH I see now that what I was asking wasn't clear. Thanks for confirming GPU and service will not work, all the answer I need for 1). But for number 2, I did not ask what I meant very well. I know how to manage window services and I use the heck out of Bonic Tasks.

Let me try again.

2) What methods do you employ to make sure the bonic client process is running and auto start the client if it is not?

Easy to do for a service, there is a built-in feature accessed via the recovery tab on the Service properties. Before I start creating my own script for monitoring the process state and restart if not currently running, I thought I would see if anyone already had something that worked effectively. Sorry for the confusion.

Fire$torm
05-25-12, 01:41 PM
DOH I see now that what I was asking wasn't clear. Thanks for confirming GPU and service will not work, all the answer I need for 1). But for number 2, I did not ask what I meant very well. I know how to manage window services and I use the heck out of Bonic Tasks.

Let me try again.

2) What methods do you employ to make sure the bonic client process is running and auto start the client if it is not?

Easy to do for a service, there is a built-in feature accessed via the recovery tab on the Service properties. Before I start creating my own script for monitoring the process state and restart if not currently running, I thought I would see if anyone already had something that worked effectively. Sorry for the confusion.

boinccmd.exe --get_state

Wiki ---> http://boinc.berkeley.edu/wiki/Boinccmd_tool

EmSti
05-25-12, 07:08 PM
Ok, I just wrote this and it's my first visual basic script, so be nice. Simple language with a few quirks, but easy enough.

BONIC Watcher will check every 30 seconds to see if the bonic client is still running. If it isn't running, it will restart it. If you want to use it, be sure the paths are correct in all three files for your desired setup. It leaves a window open which can be minimized. You will know that it detected the boinc cliect died if you see "restarting BOINC" in the window. After checking the path are correct, start it simply by running Start_BOINC_Watcher.cmd. The Stop_BOINC_Watcher.cmd isn't needed since you can simply kill the window. It was my hope to make it run hidden, so I built in a way to stop it, but I am done with it for now. I pinned the Start cmd to my Start Menu. If you put it in your Start Menu-> All Programs -> Startup, I would add another sleep command toward the beginning of the vbs script to delay the start.

To test, once BOINC Watcher is running, stop you boinc client and within 30 secs it should restart.

You can change the arguments used to start the client by editing BOINC_Args in the vbs file. You can change how often it checks the client by changing the Sleep command at the end of the vbs file.

910

ad hoc, use are your own risk.

Fire$torm
05-25-12, 10:49 PM
Not to be a jerk but the following works without any high level programming....



Title BOINC Client Checker


@ECHO OFF

CLS


:Begin

Call C:\Program Files\BOINC\boinccmd.exe --get_state


IF ERRORLEVEL 0 GOTO SUCCESS


:RESTART

CLS
ECHO.
ECHO.
ECHO.
ECHO Restarting BOINC Client

START C:\Program Files\BOINC\boinc.exe --detach_console

Pause

Goto END


:SUCCESS

ECHO.
ECHO.
ECHO.
ECHO All is well

:Note. ThE Choice command only works with Vista/Windows 7. Delete the next line if not running Vista/Windows 7.

CHOICE /N /D Y /T 5

Goto END


:END



Instructions

1) Copy and paste the above code into notepad or your preferred text editor and save it as a .bat with any name you want. You can put it in any directory you think it will be safe. Maybe the BOINC program folder.

2) If you wish not to see the command window to pop up in the middle of your screen every time the batch files runs, then create a shortcut of the batch file in the same folder and right-click on it to edit its properties. Now look towards the bottom for the Run drop-down box and select minimized, now click the OK button to save.

3) To automate the batch file use the Windows Task Scheduler and create a new task.

Don't know how to use Task Scheduler?

Here is a nice primmer ---> http://www.thewindowsclub.com/schedule-task-in-windows-7-task-scheduler
Here is a short YouTube video (Very Basic) ---> http://www.youtube.com/watch?v=8986eNlXjos
Here is another YouTube video (Detailed but long) ---> http://www.youtube.com/watch?v=Af6qgd4Yy4Q (Skip the first two and a half minutes)

Ready?

1) Start Task Scheduler and click create new task.

2) General Tab - enter something that you'll recognize in the name box, Like BOINC Client Checker, then click the radio button for "Run weather user is logged in or not" and then at the drop-down box Configure For: select Windows 7.

3) Next click the Triggers tab and then the New button. In the pop-up window do the following:

*Set begin the task to At startup

*Next under Advanced settings, check the box for Delay task for: and set for 30 minutes

*Then check the box for Repeat task every: and set it to whatever you think is good. 30 minutes will work.

*Click the OK button to close window

4) Now click the Actions tab and then the New button.

*In the pop-up window, the action box should be set to Start a program

*Click the Browse button and navigate to the batch file shortcut and select it.

*Click the OK button to close.

5) (Optional) Click the Conditions tab. Under the Power settings uncheck both boxes.

6) (Optional) Click the Settings tab

*Check the box for Run as soon as....

*Check the box for If task fails, restart every: and set to 5 minutes

7) Click the OK button, enter user password and click OK button to complete task setup. That's it, you are done!

EmSti
05-25-12, 11:27 PM
Not to be a jerk but the following works without any high level programming....



Which is why I was asking for knowledge before I starting down my own path. Your other post wasn't as helpful. The vbs script isn't exactly high level programming, just simple sleep loop with check for process; simple to start and doesn't require getting into the scheduler and is easy to stop. To each his own.

Fire$torm
05-26-12, 02:09 AM
Which is why I was asking for knowledge before I starting down my own path. Your other post wasn't as helpful. The vbs script isn't exactly high level programming, just simple sleep loop with check for process; simple to start and doesn't require getting into the scheduler and is easy to stop. To each his own.

OH sorry. I figured with your knowledge it wouldn't be hard for you to work it out. The batch file I just created for my post. Took about an hour, I hate typing.... And creating a task in task scheduler takes like two minutes.

Edit: Trust me when I saw I'm no expert on Windows or anything. I just tend to poke around stuff when I get bored. Plus I learned computers when DOS 3.3 was all the rage. Everyone had to write batch files just to get their system to run..... :P

DrPop
05-26-12, 02:47 AM
Wow...just wow! You guys are so over my head in computer jargon I don't even know what to say! :)) Guess I will just watch and learn. ;) hehe...on second thought, I will just stick to hardware - rig building and let ya'll try to make sense of this stuff! :D

Sent from my MB860 using Tapatalk 2

EmSti
05-26-12, 11:52 AM
I think my next attempt will be to incorporate a setup file and some of the options from Fire$torm's link to boincccmd. I am thinking about adding the ability to monitor memory size of boinc client, memory size of project process, and the age of both. The thought is a person sets up the limits in a config file and the action to take on the project wu. If the watcher sees it greater than the client values, it restarts the client. If it sees it greater for the project process, it will kill the process or suspend or suspend/delay/resume the project wus. I am in the thinking stage and I will need to make sure I can get the needed values (I know I can with perl).

What simple features would folks like to see?

Trying to make something that can take over the daily tasks of watching the machines and automate reactions. Something light and simple that can be run on each machine. Something people can setup fast and use easily.

Fire$torm
05-26-12, 02:54 PM
EmSti,

Good stuff there. At the moment I cannot think of anything but will keep your request in mind.

Team SETI.USA FTW **==

invisy
05-27-12, 10:13 PM
EmSti,

Good stuff there. At the moment I cannot think of anything but will keep your request in mind.

Team SETI.USA FTW **==

arewe still running coletz

EmSti
05-28-12, 02:04 AM
arewe still running coletz

You can if it is a project you like. If you are referring to the collatz part of the Pentathlon, that has been over for a week, sorry if we left you hanging out there. At the moment we are not in any challenges. At all times folks can cruch what they desire. If you desire to help us with the challenges, that would be awesome. Next one up is Simap June 1st, look for the challenge thread and add yourself in there.