Message boards :
Number crunching :
Safe Shutdown
Message board moderation
Author | Message |
---|---|
RueiKe Send message Joined: 14 Feb 16 Posts: 492 Credit: 378,512,430 RAC: 785 |
With my recent power distribution upgrades, I now have Network Management Cards in all of my UPS. This allows me to trigger system shutdown in the case of low battery when power is interrupted. I attempted this, but it looks like a shutdown while BOINC is running will stop the BOINC Manager before powering down the computer, but it appears as though MB processes are still running. You can see this behavior in the video I just posted https://youtu.be/uWBNdLmN6QY Does anyone have a script that will shutdown BOINC Manager and wait for all relevant processes to end before exiting? GitHub: Ricks-Lab Instagram: ricks_labs |
Richard Haselgrove Send message Joined: 4 Jul 99 Posts: 14649 Credit: 200,643,578 RAC: 874 |
It's not the Manager you have to worry about, but the underlying client (boinc.exe) The most easily scriptable closedown would be [BOINC program directory] boinccmd.exe --quit |
Shaggie76 Send message Joined: 9 Oct 09 Posts: 282 Credit: 271,858,118 RAC: 196 |
This is what I use for my daily shutdown when the price of electricity goes up @echo off "C:\Program Files\BOINC\boinccmd.exe" --project http://setiathome.berkeley.edu update timeout /t 300 "C:\Program Files\BOINC\boinccmd.exe" --set_run_mode never 300 timeout /t 10 "C:\Windows\System32\shutdown.exe" /p /f I like to do one last project update before shutting down in the hopes that it'll flush through any pending uploads, then I ask BOINC nicely to stop for 5 minutes, I give it 10 seconds to respond, then I shut it down. When it comes back to life it's back to default run mode (probably "always"). |
Richard Haselgrove Send message Joined: 4 Jul 99 Posts: 14649 Credit: 200,643,578 RAC: 874 |
In my case, that would be D:\BOINC\boinccmd.exe --set_run_mode never 300 and so on - no quotation marks, because I deliberately choose an installation path without any embedded spaces. For subsequent readers - remember "C:\Program Files\BOINC\" is an installation time (default) choice - YMMV. |
OzzFan Send message Joined: 9 Apr 02 Posts: 15691 Credit: 84,761,841 RAC: 28 |
I wrote this Powershell script if it helps: $path = (Get-ItemProperty -Path "HKLM:\Software\Space Sciences Laboratory, U.C. Berkeley\BOINC Setup").INSTALLDIR -Replace ".{1}$" if (Test-Path -Literalpath '$path\boinccmd.exe') { & "$path\boinccmd.exe" --project http://setiathome.berkeley.edu update & "$path\boinccmd.exe" --set_run_mode never 300 } This will pull the install directory from the registry and execute an update, then set run mode to never for 5 minutes so you can shutdown the system. Simply copy and paste this into a text file editor (or Powershell ISE), save it and give it an extestion of .ps1, then run it as needed. |
HAL9000 Send message Joined: 11 Sep 99 Posts: 6534 Credit: 196,805,888 RAC: 57 |
When I was running ~30 machines. many of them rack servers, I used the UPS management software to control BOINC via boinccmd. I setup one machine per UPS to handle the events. Which would handle BOINC for all on the systems on the given UPS. So it would be the last to shutdown & first to power on. From memory I had set it up along the lines of: On battery > 60 seconds: boinccmd --set_run_mode mode duration never 1200 On battery > 300 seconds: boinccmd --set_run_mode mode duration never On battery > 900 seconds: Do a system shutdown On AC > 600 seconds: boinccmd --set_run_mode mode duration auto Each .bat would be something like : @ECHO OFF pushd %~dp0 set cmdpath=D:\BOINC\boinccmd set pass=password set cmd=--passwd %pass% --set_run_mode mode duration never 1200 %cmdpath% --host NODE1 %cmd% %cmdpath% --host NODE2 %cmd% %cmdpath% --host NODE3 %cmd% %cmdpath% --host NODE4 %cmd% %cmdpath% --host NODE5 %cmd% exit SETI@home classic workunits: 93,865 CPU time: 863,447 hours Join the [url=http://tinyurl.com/8y46zvu]BP6/VP6 User Group[ |
RueiKe Send message Joined: 14 Feb 16 Posts: 492 Credit: 378,512,430 RAC: 785 |
Thanks everyone who provided input. Based on the examples given, here is what I implemented. I had to use a longer timeout after set_run_mode since I am also running Atlas@Home, and it takes longer for Atlas tasks to end. @echo off echo "UPS Low battery shutdown script execution" "C:\Program Files\BOINC\boinccmd.exe" --set_run_mode never 300 timeout /t 35 "C:\Program Files\BOINC\boinccmd.exe" --quit timeout /t 2 echo "Shutting down..." exit GitHub: Ricks-Lab Instagram: ricks_labs |
RueiKe Send message Joined: 14 Feb 16 Posts: 492 Credit: 378,512,430 RAC: 785 |
When I was running ~30 machines. many of them rack servers, I used the UPS management software to control BOINC via boinccmd. Were you using a generic UPS management tool or something from the UPS maker? I assume that with SNMP protocol, it would be possible to develop alternative tools for this. The software that came with my UPS network management card doesn't seem to have the flexibility that you described., so I am looking for an alternative. GitHub: Ricks-Lab Instagram: ricks_labs |
BilBg Send message Joined: 27 May 07 Posts: 3720 Credit: 9,385,827 RAC: 0 |
No need for "UPS network management" boinccmd itself can access LAN In the line: %cmdpath% --host NODE1 %cmd% "NODE1" is the name or IP of computer on LAN http://boinc.berkeley.edu/wiki/Boinccmd_tool That computer's BOINC have to allow remote access: http://boinc.berkeley.edu/wiki/Controlling_BOINC_remotely  - ALF - "Find out what you don't do well ..... then don't do it!" :)  |
HAL9000 Send message Joined: 11 Sep 99 Posts: 6534 Credit: 196,805,888 RAC: 57 |
When I was running ~30 machines. many of them rack servers, I used the UPS management software to control BOINC via boinccmd. The software I was using was the enterprise or business versions of whatever APC provides. I would imagine there is probably some very similar free or open source software that has most of the same functionality for any SNMP UPS device. The UPSs that I had could also send IPMI off/on commands. So I used the UPS firmware to control the boot order for the systems. SETI@home classic workunits: 93,865 CPU time: 863,447 hours Join the [url=http://tinyurl.com/8y46zvu]BP6/VP6 User Group[ |
©2024 University of California
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.