optional arguments not being passed to boinc client in ubuntu

Message boards : Questions and problems : optional arguments not being passed to boinc client in ubuntu
Message board moderation

To post messages, you must log in.

AuthorMessage
Profile Joseph Stateson
Volunteer tester
Avatar

Send message
Joined: 27 Jun 08
Posts: 641
United States
Message 93984 - Posted: 1 Dec 2019, 17:10:11 UTC - in response to Message 93977.  
Last modified: 1 Dec 2019, 17:53:43 UTC

Making some progress: I now know that I really don't know much about Linux and how startup scripts work.

From a discussion here months ago I was told that /systemd/system,boinc-client.service is what really starts boinc

that script has the following

[Unit]
Description=Berkeley Open Infrastructure Network Computing Client
Documentation=man:boinc(1)
After=network-online.target

[Service]
Type=simple
ProtectHome=true
PrivateTmp=true
ProtectSystem=strict
ProtectControlGroups=true
ReadWritePaths=-/var/lib/boinc -/etc/boinc-client
Nice=10
User=boinc
WorkingDirectory=/var/lib/boinc
ExecStart=/usr/bin/boinc
ExecStop=/usr/bin/boinccmd --quit
ExecReload=/usr/bin/boinccmd --read_cc_config
ExecStopPost=/bin/rm -f lockfile
IOSchedulingClass=idle
# The following options prevent setuid root as they imply NoNewPrivileges=true
# Since Atlas requires setuid root, they break Atlas
# In order to improve security, if you're not using Atlas,
# Add these options to the [Service] section of an override file using
# sudo systemctl edit boinc-client.service
#NoNewPrivileges=true
#ProtectKernelModules=true
#ProtectKernelTunables=true
#RestrictRealtime=true


guess what? that service script has no place for an argument. As it is, there is no way to pass any arguments using /etc/default/boinc-client or even /etc/init.d/boinc-client !!!

at least when using ppa:costamagnagianfranco which is where I get anything later than versoin 7.9
maybe another ppa has a better solution???

IMHO of course

[EDIT]
I am guessing I could edit the file and add the arguments behind the /usr/bin/boinc
if so, then obviously that start script I have been using does not do what it says it can do.
A suggestion by Richard was to just use systemcrl to start boinc
maybe that is all that init.d script does and nothing else.

[EDIT2]
After adding my boinc optional argument behind
ExecStart=/usr/bin/boinc

I had to run
systemctl daemon-reload 

before the client would start with the new argument. A real PITA. However, it was nice of the OS to advise me to use that reload command. Saved googleing for the problem
ID: 93984 · Report as offensive
Richard Haselgrove
Volunteer tester
Help desk expert

Send message
Joined: 5 Oct 06
Posts: 5078
United Kingdom
Message 93987 - Posted: 1 Dec 2019, 17:48:37 UTC - in response to Message 93984.  

A suggestion by Richard was to just use systemcrl to start boinc
All I can say is that the systemctl call I posted 'works for me' on a recent Ubuntu-based installation: it starts and stops the client cleanly when I need to change things, and don't want to bother rebooting the whole machine.

Why are you trying to pass arguments to the BOINC client, anyway?
ID: 93987 · Report as offensive
Profile Joseph Stateson
Volunteer tester
Avatar

Send message
Joined: 27 Jun 08
Posts: 641
United States
Message 93988 - Posted: 1 Dec 2019, 18:00:50 UTC - in response to Message 93987.  


Why are you trying to pass arguments to the BOINC client, anyway?


I am fine-tuning a special "mod" of the client for super-secret event and only Juan BFP and Keith Myers know what I am up to.

ID: 93988 · Report as offensive
Richard Haselgrove
Volunteer tester
Help desk expert

Send message
Joined: 5 Oct 06
Posts: 5078
United Kingdom
Message 93989 - Posted: 1 Dec 2019, 18:12:43 UTC - in response to Message 93988.  

Fair enough. I've run several of Juan's mods - that's my main reason for stopping and starting BOINC. So systemctl works in that context, too.
ID: 93989 · Report as offensive
Profile Joseph Stateson
Volunteer tester
Avatar

Send message
Joined: 27 Jun 08
Posts: 641
United States
Message 94033 - Posted: 5 Dec 2019, 18:18:08 UTC
Last modified: 5 Dec 2019, 18:59:28 UTC

Discovered how to pass command line arguments to boinc using the existing ubuntu "default" way. A mod to the service is required

First: the /etc/init.d/boinc-client <start | restart | stop > runs the service but cannot pass arguments.
According to the bible arguments need to be in an environmental file.
That file is not identified in the service and possibly that init.d file is going to be depreciated.

in /lib/systemd/system/boinc-client.service

where
WorkingDirectory=/var/lib/boinc
ExecStart=/usr/bin/boinc
ExecStop=/usr/bin/boinccmd --quit


add the following
WorkingDirectory=/var/lib/boinc
ExecStart=/usr/bin/boinc $BOINC_OPTS
EnvironmentFile=/etc/default/boinc-client
ExecStop=/usr/bin/boinccmd --quit


Where that "default" file has the following
# Here you can specify additional options to pass to the BOINC core client.
# Type 'boinc --help' or 'man boinc' for a full summary of allowed options.
#BOINC_OPTS="--allow_remote_gui_rpc"
BOINC_OPTS=""
# Scheduling options


add your optional arguments at that BOINC_OPTS
save service changes with "systemctl daemon-reload"
then start client with
sudo systemctl start boinc-client

If you made a mistake in the arguments, use "journalctl -xe" to see what systemctl did

Not sure who decides how Boinc is installed in Linux, but I think this change needs to be incorporated in any Linux releases.

[EDIT] I do not see any of this code at the Boinc GitHub so I assume it is controlled elsewhere. I can make a suggestion about the change there but it might just clutter up the "issue" database.
----just looked over there and other people have requested changes to the service so I will add this in.
ID: 94033 · Report as offensive
Profile Keith Myers
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 17 Nov 16
Posts: 863
United States
Message 94044 - Posted: 6 Dec 2019, 1:12:56 UTC - in response to Message 93984.  

at least when using ppa:costamagnagianfranco which is where I get anything later than versoin 7.9
maybe another ppa has a better solution???

Confused. From Gianfranco's ppa, I see BOINC 7.16.3 listed for Ubuntu 18.04, 19.04 and 19.10. You should be getting that version. If you are still getting 7.9.3 you are pulling BOINC from the distro and not the ppa. You need to update your sources list. Check the Software Sources list and make sure you see the ppa listed. You might have to provide the public key for the ppa. Should have all been handled by the add-apt-repository unless you still haven't issued the apt update.
https://launchpad.net/~costamagnagianfranco/+archive/ubuntu/boinc
ID: 94044 · Report as offensive

Message boards : Questions and problems : optional arguments not being passed to boinc client in ubuntu

Copyright © 2024 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.