Index  | Recent Threads  | Unanswered Threads  | Who's Active  | Guidelines  | Search
 

Quick Go »
No member browsing this thread
Thread Status: Active
Total posts in this thread: 9
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 2328 times and has 8 replies Next Thread
jonathandl
Advanced Cruncher
Joined: Nov 12, 2007
Post Count: 106
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Linux: how to run BOINC as an application instead of as a service?

I recently installed BOINC on an Xubuntu computer, and noticed that by default it runs automatically at startup. Instead, though, want it to run the same way as a normal program on a Mac or PC, that is, crunch when I open the BOINC Manager manually; so I skipped the second step of the installation instructions, "sudo systemctl boinc-client enable."

Skipping that step didn't prevent automatic execution at boot time, so I tried "systemctl boinc-client disable," but got these error messages:
$ systemctl disable boinc-client
Synchronizing state of boinc-client.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install disable boinc-client
insserv: f open(.depend.stop): Permission denied
update-rc.d: error: Permission denied

When I tried with "sudo" in front of it, I got a whole bunch more errors:
$ sudo systemctl disable boinc-client
[sudo] password for jdl:
Synchronizing state of boinc-client.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install disable boinc-client
insserv: warning: current start runlevel(s) (empty) of script `boinc-client' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `boinc-client' overrides LSB defaults (0 1 6).
insserv: warning: current start runlevel(s) (empty) of script `boinc-client' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `boinc-client' overrides LSB defaults (0 1 6).

What do these error messages mean, and do they reflect a condition that could impair the accuracy of Results? Should I uninstall and reinstall BOINC, or at least reset the World Community Grid Project?

Anyway, opening the BOINC manager does not start the BOINC client; either I have to leave automatic startup enabled, or manually enter "systemctl start boinc-client" from a Terminal window. How can I start the BOINC manager and BOINC client (simultaneously) from the Linux desktop?
----------------------------------------
[Edit 3 times, last edit by jonathandl at Sep 20, 2019 2:26:30 AM]
[Sep 20, 2019 2:01:01 AM]   Link   Report threatening or abusive post: please login first  Go to top 
floyd
Cruncher
Joined: May 28, 2016
Post Count: 47
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Linux: how to run BOINC as an application instead of as a service?

I recently installed BOINC on an Xubuntu computer, and noticed that by default it runs automatically at startup. Instead, though, want it to run the same way as a normal program on a Mac or PC, that is, crunch when I open the BOINC Manager manually

A clear description of what you want, a good start. Just a side note.

I skipped the second step of the installation instructions, "sudo systemctl boinc-client enable."

Strange. I would expect the client to be enabled and running after installation, so no need to do that manually. But anyhow, you want it disabled and you achieved that.

I tried "systemctl boinc-client disable," but got these error messages

It's systemctl disable boinc-client as you quoted. That doesn't stop the client by the way. Don't try to explain the exact error messages, it all comes down to missing permissions.

When I tried with "sudo" in front of it, I got a whole bunch more errors

That's just warnings about the way autostart is configured. If (not) starting the client automatically works as expected you can ignore them. No action required.

Anyway, opening the BOINC manager does not start the BOINC client

So that's the whole problem here. Unfortunately I don't have a clear idea on how to solve it. Maybe more information could help someone to work it out, so I'll just ask a few assorted questions that come to mind.
What's the boinc version? I see the 7.14.2 Manager has a "Run the client" option that my previous 7.6.33 did not have. Not sure if it works as expected though. Exactly how do you start the Manager? Did you add yourself to the boinc group? What's the permissions of /var/lib/boinc-client, /etc/boinc-client and their contents? Any useful output in /var/log or ~/.BOINC, maybe even in /var/lib/boinc-client, or in the terminal if you start the Manager from there?
[Sep 20, 2019 9:19:07 AM]   Link   Report threatening or abusive post: please login first  Go to top 
jonathandl
Advanced Cruncher
Joined: Nov 12, 2007
Post Count: 106
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Linux: how to run BOINC as an application instead of as a service?

So that's the whole problem here. Unfortunately I don't have a clear idea on how to solve it. Maybe more information could help someone to work it out, so I'll just ask a few assorted questions that come to mind. What's the boinc version? I see the 7.14.2 Manager has a "Run the client" option that my previous 7.6.33 did not have. Not sure if it works as expected though. Exactly how do you start the Manager? Did you add yourself to the boinc group? What's the permissions of /var/lib/boinc-client, /etc/boinc-client and their contents? Any useful output in /var/log or ~/.BOINC, maybe even in /var/lib/boinc-client, or in the terminal if you start the Manager from there?

Sorry about the delay in responding. I actually installed BOINC on a second Xubuntu computer, and got a similar (but not the same) result.

Firstly, the Manager that I installed now does have a "Run the Client" preference option that the manager on the other computer doesn't. But interestingly, I installed BOINC only a few days apart...

...That being said, both computers are running XUbuntu but one is running the 32-bit OS version 16.04.6 LTS, and the newer computer is running 64-bit Xubuntu 19.04. On both computers I followed the instructions by going to https://www.worldcommunitygrid.org/ms/viewDownloadAgain.action# then clicking the radio button for Linux Ubuntu/Debian except that on the first computer I had skipped the "sudo systemctl enable boinc-client" step and on the new computer I followed the instructions to the letter and then, after running some jobs, decided to do "systemctl disable boinc-client" followed by "sudo systemctl disable boinc-client."

On the first computer (Xubuntu 16.04.6), if I restart the computer then launch the BOINC manager by typing "boincmgr -d /var/lib/boinc" the GUI comes up but it doesn't seem to try to start the client.

On the new computer (Xubuntu 19.04), if I launch the BOINC manager from the xfce4 Whisker menu then I can see with ps axwf that it tries to launch the BOINC client once, then it displays an error: "The BOINC client has exited unexpectedly 3 times in the last 3 minutes. Would you like to restart it again?"

Following information is from the new computer only:
BOINC manager version 7.14.2 (x64)
BOINC client version 7.14.2 for x86_64-pc-linux-gnu
CPU: AMD Opteron(tm) X3216 APU.
I added myself to the BOINC group according to step #4 of the instructions.
Permissions and ownership of /var/lib/boinc-client folder:
drwxr-xr-x 5 boinc boinc
And its contents:
Varies, but most files owned by boinc boinc with -rw-r--r-- permissions, symbolic links owned by root root with lrwxrwxrwx permissions, and directories with drwxrwx--x 2 boinc boinc permissions and ownership.
Permissions and ownership of /etc/boinc-client folder:
drwxr-xr-x 2 root root 4096 Sep 25 04:14 .
drwxr-xr-x 141 root root 12288 Sep 25 20:39 ..
-rw-rw-r-- 1 boinc boinc 356 Jan 30 2019 cc_config.xml
-rw-rw-r-- 1 root boinc 1501 Sep 25 05:04 global_prefs_override.xml
-rw-r----- 1 root boinc 1 Jan 30 2019 gui_rpc_auth.cfg
-rw-r--r-- 1 root boinc 296 Jan 30 2019 remote_hosts.cfg

Interesting log entries from /var/log/syslog (But this only happened once):
Sep 25 19:38:18 ProLiant-MicroServer-Gen10 boinccmd[6932]: can't connect to local host
Sep 25 19:38:18 ProLiant-MicroServer-Gen10 systemd[1]: boinc-client.service: Control process exited, code=exited, status=1/FAILURE
Sep 25 19:38:18 ProLiant-MicroServer-Gen10 systemd[1]: boinc-client.service: Failed with result 'exit-code'
.
[Sep 26, 2019 2:03:57 AM]   Link   Report threatening or abusive post: please login first  Go to top 
floyd
Cruncher
Joined: May 28, 2016
Post Count: 47
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Linux: how to run BOINC as an application instead of as a service?

Firstly, the Manager that I installed now does have a "Run the Client" preference option that the manager on the other computer doesn't. But interestingly, I installed BOINC only a few days apart...

...That being said, both computers are running XUbuntu but one is running the 32-bit OS version 16.04.6 LTS, and the newer computer is running 64-bit Xubuntu 19.04.
If I understand the Ubuntu version scheme correctly these two releases are three years apart and so will be the included BOINC versions.
it displays an error: "The BOINC client has exited unexpectedly 3 times in the last 3 minutes. Would you like to restart it again?"
It would be nice if the reason for that was logged somewhere. Maybe you can find it but I think I know what's wrong.
It's the permissions. Members of the boinc group don't have the same permissions as the boinc user and that's not sufficient to run the client. Most important is the lack of write permissions on the data directory. Instead of trying to fix that completely and permanently you could just create your own data directory where you have full access, say $HOME/my-boinc, and then pass that to the Manager instead of /var/lib/boinc. That way you would have two separate data directories, the global one which is inactive, and your personal one which you'll use from now on. I expect that to be detected as a new device but that could depend on the individual projects. If you want to avoid it you can initially make your personal directory a copy of the global one but then you'll have to make sure to never access the global data directory again. It will be permanently out of sync and that is sure to cause new trouble should it ever be used again, even accidentally. I advise against this approach.
[Sep 28, 2019 7:54:49 AM]   Link   Report threatening or abusive post: please login first  Go to top 
OldChap
Veteran Cruncher
UK
Joined: Jun 5, 2009
Post Count: 978
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Linux: how to run BOINC as an application instead of as a service?

I have never felt the need to stop Boinc running at startup but....
In view of the fact you have Boinc already installed you could use command line as follows:
Ubuntu versions use:

systemctl disable service

Which will disable the service and it won't restart after a reboot.

The other commands are as follows:

service --status-all

To find the service name

systemctl start service

Start a service. Does not persist after reboot

systemctl stop service

Stop a service. Does not persist after reboot

systemctl restart service

Restart a service

systemctl status service

Shows the status of a service. Shows if a service is currently running.

systemctl enable service

Turns the service on. It persists after reboot.

systemctl disable service

Turns the service off. It persists after reboot.

From what is written in above posts the key one here seems to be
service --status-all

You need to see what is running and what it is called for the purposes of this command.

You might also want to play around after reading this:
https://boinc.berkeley.edu/wiki/Installing_on_Linux

Also from the Wiki:

n Debian-based Linux distributions you use the update-rc.d command to turn a system service (daemon) on or off at boot time.

update-rc.d boinc-client defaults 98
-tells the system to start the BOINC client as a daemon at boot time
update-rc.d boinc-client remove
- tells the system not to start the BOINC client at boot time
See the man page for update-rc.d for more details.
https://boinc.berkeley.edu/wiki/Stop_or_start_BOINC_daemon_after_boot
----------------------------------------

----------------------------------------
[Edit 1 times, last edit by OldChap at Sep 28, 2019 12:12:19 PM]
[Sep 28, 2019 11:52:19 AM]   Link   Report threatening or abusive post: please login first  Go to top 
floyd
Cruncher
Joined: May 28, 2016
Post Count: 47
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Linux: how to run BOINC as an application instead of as a service?

systemctl disable service
Already done.

systemctl start service

Start a service. Does not persist after reboot

systemctl stop service

Stop a service. Does not persist after reboot
The OP wouldn't want to do that manually. Maybe with a little script like

if not client_is_running then
start_client
boincmgr
stop_client
else
boincmgr
endif

Not exactly what was asked for but maybe the best solution. It would always use the existing installation, whether that was permanently running or not.

Also from the Wiki:

n Debian-based Linux distributions you use the update-rc.d command to turn a system service (daemon) on or off at boot time.
I'm not sure if this is still true with systemd all over the place.
[Sep 29, 2019 6:43:12 AM]   Link   Report threatening or abusive post: please login first  Go to top 
jonathandl
Advanced Cruncher
Joined: Nov 12, 2007
Post Count: 106
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Linux: how to run BOINC as an application instead of as a service?

It would be nice if the reason for that was logged somewhere. Maybe you can find it but I think I know what's wrong. It's the permissions. Members of the boinc group don't have the same permissions as the boinc user and that's not sufficient to run the client. Most important is the lack of write permissions on the data directory. Instead of trying to fix that completely and permanently you could just create your own data directory where you have full access, say $HOME/my-boinc, and then pass that to the Manager instead of /var/lib/boinc.

I just ran the boinc_manager while doing tail -f on the /var/log/syslog. Nothing relevant to BOINC at all. Simultaneously I did a ps axwf:
$ ps axwf | grep -A 3 boinc
1386 ? Sl 0:03 | \_ boincmgr
1411 ? SLl 0:00 | \_ /usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/WebKitWebProcess 4 17
1412 ? SLl 0:00 | \_ /usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/WebKitNetworkProcess 5 17
1454 ? S 0:00 | \_ /usr/bin/boinc --redirectio --launched_by_manager

But if it's a permissions error then don't I just need to do
chmod -v -R g+w /var/lib/boinc-client and then reset the project?
That won't corrupt any Results, will it? (I assume that reseting the project would eliminate any risk of that happening.)
----------------------------------------
[Edit 1 times, last edit by jonathandl at Sep 30, 2019 11:38:06 PM]
[Sep 30, 2019 11:37:41 PM]   Link   Report threatening or abusive post: please login first  Go to top 
floyd
Cruncher
Joined: May 28, 2016
Post Count: 47
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Linux: how to run BOINC as an application instead of as a service?

But if it's a permissions error then don't I just need to do
chmod -v -R g+w /var/lib/boinc-client and then reset the project?
Don't reset the project, that will destroy any work in progress. You could do the recursive chmod while boinc is not running and you should be okay right after that. But what happens to new files or files being rewritten? Yours will get your ownership and permissions, the daemon, if ever run again, will use others. That might work or not, in any case it's not a clean solution. Don't insist on using the daemon's working directory for yourself. Either make the daemon run when you want it or run the client yourself (through the manager) and use your own directory. I like the former solution better now as you can easily switch between this and the original setup.
[Oct 6, 2019 9:06:15 AM]   Link   Report threatening or abusive post: please login first  Go to top 
jonathandl
Advanced Cruncher
Joined: Nov 12, 2007
Post Count: 106
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Linux: how to run BOINC as an application instead of as a service?

But if it's a permissions error then don't I just need to do chmod -v -R g+w /var/lib/boinc-client and then reset the project?
Don't reset the project, that will destroy any work in progress. You could do the recursive chmod while boinc is not running and you should be okay right after that. But what happens to new files or files being rewritten? Yours will get your ownership and permissions, the daemon, if ever run again, will use others. That might work or not, in any case it's not a clean solution. Don't insist on using the daemon's working directory for yourself. Either make the daemon run when you want it or run the client yourself (through the manager) and use your own directory. I like the former solution better now as you can easily switch between this and the original setup.

Thanks for your help; now I got an update. First I upgraded Xubuntu itself from 19.04 to 19.10, and now when I open the BOINC manager I get an empty BOINC-manager window (no longer any error messages at all). Then I tried the "sudo chmod --verbose --recursive g+w /var/lib/boinc-client" solution, and it didn't work; no change before and after. So I wonder if the original diagnosis of a permissions issue is correct. (Interestingly, the new BOINC manager that comes with Xubuntu 19.10 doesn't even have a "quit" command, just a command to close the window.)
[Oct 30, 2019 12:17:20 AM]   Link   Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Post new Thread