Starting BOINC clients and attaching projects, except from a single terminal

Message boards : BOINC client : Starting BOINC clients and attaching projects, except from a single terminal
Message board moderation

To post messages, you must log in.

AuthorMessage
Hermanoid

Send message
Joined: 15 Aug 17
Posts: 2
United States
Message 80489 - Posted: 27 Aug 2017, 19:20:50 UTC
Last modified: 27 Aug 2017, 19:22:07 UTC

Hello all,

I have a bit of a "challenge case" here.

I'm trying to set up an array of BOINC clients (with some spare $$$ I got for free in an azure deal), from what amounts to a single command prompt/terminal.

Alas, there is a difficulty: The BOINC client runs effectively forever , and it blocks the executing command line/terminal from executing other commands whilst it runs. Since Boinccmd needs a running client to attach projects and do control operations to, it is impossible to attach BOINC projects to the client from the same terminal as the client.

The logical solution to this is to run the client seperately:
start boinc.exe

but, with that, subsequent commands to configure/attach/otherwise control the BOINC client will probably execute before the the client is fully initialized (A race condition, as they call it).

I have found what seem to be three different option to solving this, all of which could work, none of which I know how to implement:
Option 1, attach beforehand:
$ setting-dinglehopper --project-attach URL WEAKKEY
$ boinc.exe


Option 2, attach in the same command:
$ boinc.exe --project-attach URL WEAKKEY

EDIT: I did figure out how to do this one, although apparently it is not recommended, and I'd like a better solution.

or Option 3, somehow wait for the client to start:
$ start boinc.exe
$ boinccmd --wait-for-boinc-client?
$ boinccmd -project-attach URL WEAKKEY


If none of these work, I could work something out using remote RPCs... but avoiding that would be so~ much easier.

Batch (.bat) files ARE a possibility. The operating system of choice is Linux, although Windows is a possibility as well. (This is Microsoft Azure we're talking about here).

Thanks for any tips!
Lucas Niewohner (or Hermanoid, whichever you prefer)
ID: 80489 · Report as offensive     Reply Quote
BobCat13
Help desk expert

Send message
Joined: 6 Dec 06
Posts: 116
United States
Message 80491 - Posted: 28 Aug 2017, 1:47:48 UTC - in response to Message 80489.  

https://boinc.berkeley.edu/wiki/client_configuration#Command-line_options

For Linux, use --daemon

For Windows, use --detach_console

That will start the client and return control of the terminal to you.
ID: 80491 · Report as offensive     Reply Quote
Hermanoid

Send message
Joined: 15 Aug 17
Posts: 2
United States
Message 80522 - Posted: 29 Aug 2017, 3:06:55 UTC - in response to Message 80491.  

Thanks BobCat, that's a link I didn't know about.

However, it doesn't look like --detach_console will complete the Initialization process on the client before returning control, so running a control command like
boinccmd --project_attach URL WeakKey

...immediately after starting the client will almost certainly cause the control command to be executed before the client is initialized, resulting in an error.

If --detach_console is to work, there will have to be a subsequent command to wait until the client is started.

All of that said, I think the --attach_project command (on the client itself) will work just fine.

Thanks for the help!
ID: 80522 · Report as offensive     Reply Quote
Profile Ageless
Volunteer moderator
Project administrator
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 12092
Netherlands
Message 80533 - Posted: 29 Aug 2017, 12:21:46 UTC - in response to Message 80522.  

The --detach_console command closes the command line window but leaves the client running. It won't close the command line window until all of the commands the client has to full fill have been done, and the client itself is fully initialized.
Jord
Only partially available.
Please do not private message me for tech support. Use the forums for that. Tech PMs will be ignored.
ID: 80533 · Report as offensive     Reply Quote
HAL9000
Help desk expert
Avatar

Send message
Joined: 13 Jun 14
Posts: 78
United States
Message 80534 - Posted: 29 Aug 2017, 12:39:23 UTC - in response to Message 80522.  
Last modified: 29 Aug 2017, 12:43:31 UTC

Thanks BobCat, that's a link I didn't know about.

However, it doesn't look like --detach_console will complete the Initialization process on the client before returning control, so running a control command like
boinccmd --project_attach URL WeakKey

...immediately after starting the client will almost certainly cause the control command to be executed before the client is initialized, resulting in an error.

If --detach_console is to work, there will have to be a subsequent command to wait until the client is started.

All of that said, I think the --attach_project command (on the client itself) will work just fine.

Thanks for the help!

Well there is a command for that.
TIMEOUT [/T] timeout [/NOBREAK]

Description:
    This utility accepts a timeout parameter to wait for the specified
    time period (in seconds) or until any key is pressed. It also
    accepts a parameter to ignore the key press.

Parameter List:
    /T        timeout       Specifies the number of seconds to wait.
                            Valid range is -1 to 99999 seconds.

    /NOBREAK                Ignore key presses and wait specified time.

    /?                      Displays this help message.

NOTE: A timeout value of -1 means to wait indefinitely for a key press.

Examples:
    TIMEOUT /?
    TIMEOUT /T 10
    TIMEOUT /T 300 /NOBREAK
    TIMEOUT /T -1

Normally I'll give BOINC about 5 seconds before sending any commands to it.
I will also run a benchmark before attaching projects. So that I don't have to wait for it to run on its own.
ID: 80534 · Report as offensive     Reply Quote

Message boards : BOINC client : Starting BOINC clients and attaching projects, except from a single terminal

Copyright © 2017 University of California. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.