boinc client arguments at boot, systemctl issues

Message boards : Questions and problems : boinc client arguments at boot, systemctl issues
Message board moderation

To post messages, you must log in.

AuthorMessage
Glenn C

Send message
Joined: 15 Aug 22
Posts: 2
Message 109610 - Posted: 15 Aug 2022, 21:26:21 UTC

Hi,

I have a new install of Linux Mint 20.3 with boinc 7.16.6. I've had issues with running the client at boot with appropriate arguments. I have something that now works but I'd be interested in comments on whether I'm going about it the right way.

By default, the client starts at boot but runs with no arguments, just /usr/bin/boinc, but I would like the client to start with arguments at boot time:

/usr/bin/boinc --allow_remote_gui_rpc --dir /work/boinc

which is how the client starts on another system of mine that doesn't use systemctl. The default boot config comes from /lib/systemd/system/boinc-client.service and contains the following key line:

ExecStart=/usr/bin/boinc

note no arguments. I'd be interested in why the default for systemctl was chosen to be different to the way /etc/init.d/boinc-client starts the client.

So I first looked at /etc/init.d/boinc-client which has this line near the top:

. /lib/lsb/init-functions

which hands over execution to systemctl and then exits at this point in /etc/init.d/boinc-client (confusing). That means /etc/default/boinc-client is not read and /etc/init.d/boinc-client will not start the client with the default arguments specified in that file.

However, adding the following variable to /etc/init.d/boinc-client causes the systemctl start to be bypassed and /etc/init.d/boinc-client will function normally:

SYSTEMCTL_SKIP_REDIRECT=yes
. /lib/lsb/init-functions

So at least I had a way to start the client with my required command line arguments. Ideally though this should be handled with systemctl (which I'm not so familiar with).

After some reading, I created a service override in /etc/systemd/system/boinc-client.service.d/override.conf
[Service]
WorkingDirectory=/work/boinc-client
ReadWritePaths=-/work/boinc-client -/etc/boinc-client
ExecStart=
ExecStart=/usr/bin/boinc --allow_remote_gui_rpc --dir /work/boinc-client


Note the first ExecStart= line is needed to clear the ExecStart default value in /lib/systemd/system/boinc-client.service. Otherwise this generates an error that only one use of ExecStart is allowed with Type=simple.

Then run:
sudo systemctl daemon-reload
sudo systemctl start boinc-client
systemctl status boinc-client


All seems to be ok at this point and I've checked it starts correctly on boot.

My question is whether this is the correct way of setting up arguments for the boinc-client, similar to the way /etc/init.d/boinc-client would function? Systemctl has an EnvironmentFile option that could possibly be used to setup variables that could be used in the command (see https://superuser.com/questions/728951/systemd-giving-my-service-multiple-arguments) in the same way of /etc/default/boinc-client but I'm not sure I need that (yet, anyway).

Comments welcome and anyone shedding light on why systemctl start at boot doesn't use the arguments that /etc /init.d/boinc-client does?

Thanks, Glenn
ID: 109610 · Report as offensive

Message boards : Questions and problems : boinc client arguments at boot, systemctl issues

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