boidcmd
boidcmd copied to clipboard
Authorization error after reboot
After a reboot, the BOINC Daemon does not respond to unauthorized rpc commands. The boinccmd tool needs to properly authenticate by including an rpc password with each request made using boinccmd. The boincd process does run correctly, and the user can manually control it by issuing rpc commands from inside the BOINC bin directory using the boinccmd tool.
This is likely because we need to add a systemd or init.d script to automatically start boinc daemon on a reboot. I can whip one up for system.d if you like.
BOINC is already set to start on boot as far as I understand. It starts and runs on boot by default.
yes sorry i just saw it... indeed...
[Unit]
Description=Berkeley Open Infrastructure Network Computing Client
After=network.target
[Service]
Nice=10
User=boinc
PermissionsStartOnly=yes
ExecStartPre=/usr/bin/touch /var/log/boinc.log /var/log/boincerr.log
ExecStartPre=/bin/chown boinc:boinc /var/log/boinc.log /var/log/boincerr.log
#ExecStart=/usr/bin/boinc --dir /var/lib/boinc-client
ExecStart=/bin/sh -c '/usr/bin/boinc --dir /var/lib/boinc-client >/var/log/boinc.log 2>/var/log/boincerr.log'
ExecReload=/usr/bin/boinccmd --read_cc_config
ExecStopPost=/bin/rm -f /var/lib/boinc-client/lockfile
IOSchedulingClass=idle
[Install]
WantedBy=multi-user.target
I think it's related to this issue. https://github.com/BOINC/boinc/issues/2439 The only workaround that I have found is to call boincmd from inside the same directory as the executable and on some systems you also need to include the rpc password. The implementation that I use in the GUI Desktop app works reliably but this functionality was never ported to this linux cli tool. Look at line 215 here for the proper solution: https://github.com/Boid-John/BoidDesktop/blob/82f192bc11425068094c69c96a6f6dae96f0ad9e/src/boinc.js#L215
On Wed, Aug 7, 2019 at 6:31 AM Gary Hobson [email protected] wrote:
yes sorry i just saw it... indeed...
[Unit] Description=Berkeley Open Infrastructure Network Computing Client After=network.target
[Service] Nice=10 User=boinc PermissionsStartOnly=yes ExecStartPre=/usr/bin/touch /var/log/boinc.log /var/log/boincerr.log ExecStartPre=/bin/chown boinc:boinc /var/log/boinc.log /var/log/boincerr.log #ExecStart=/usr/bin/boinc --dir /var/lib/boinc-client ExecStart=/bin/sh -c '/usr/bin/boinc --dir /var/lib/boinc-client >/var/log/boinc.log 2>/var/log/boincerr.log' ExecReload=/usr/bin/boinccmd --read_cc_config ExecStopPost=/bin/rm -f /var/lib/boinc-client/lockfile IOSchedulingClass=idle
[Install] WantedBy=multi-user.target
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Boid-John/boidcmd/issues/2?email_source=notifications&email_token=AHGS4R676LZAEG4VZBWWBHDQDKXC3A5CNFSM4GT7KDF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3YDA7A#issuecomment-519057532, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGS4R5YNFWLRWOIJU3TVHLQDKXC3ANCNFSM4GT7KDFQ .
-- John Heeter Founder @ Boid.com
Hi John,
While your proposed solution may work on Windows, it wont on Linux, specifically due to this line
var pass = await fs.readFile(path.join(BOINCPATH, 'gui_rpc_auth.cfg'), 'utf8')
gui_rpc_auth.cfg does not have read permissions for others by default only for the root and boinc user. any non-root user executing boidcmd trying to read that file would fail with permission denied.
I think the problem is somewhere else, i noticed that by default the boinc installation does not enable --allow_remote_gui_rpc , this is something that needs to be set in /etc/default/boinc-client
I have not been able to reproduce this reboot perms issue myself on ubuntu16 desktop, boiccmd by default always reads the /etc/boinc-client/gui_rpc_auth.cfg file so there is no need to use --pass , unless your doing this from another server ( then you would need --allow_remote_guide_rpc option for that to work ). could you specify which exact OS/install steps led to a reboot failing to auth ? Note: I even manually added a random pass in gui_rpc_auth.cfg , and it still worked after a reboot for me.
Good insight. I'll see if I can get a repro, I assumed the issue was more prevalent.