Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boinc client doesn't have protection against accidental running multiple instances on sam,e datadir #5766

Closed
kotenok2000 opened this issue Aug 18, 2024 · 5 comments

Comments

@kotenok2000
Copy link

kotenok2000 commented Aug 18, 2024

Describe the bug
Boinc client doesn't have protection against accidental running multiple instances with same datadir
Steps To Reproduce

  1. Install https://boinc.berkeley.edu/dl/boinc_ubuntu_7.16.6_x86_64-pc-linux-gnu.sh
  2. replace files with files from https://boinc.berkeley.edu/dl/linux/stable/jammy/pool/main/b/boinc-client/boinc-client_8.0.2-715_amd64.deb and https://boinc.berkeley.edu/dl/linux/stable/jammy/pool/main/b/boinc-manager/boinc-manager_8.0.2-715_amd64.deb
  3. run it with ./run_client
  4. switch to a new terminal.
  5. run it again with ./run_client
    Expected behavior
    Boinc client detects it is already running with same datadir and closes
    Screenshots
    If applicable, add screenshots to help explain your problem.

System Information

  • OS: Ubuntu 22.04
  • BOINC Version: boinc-client_8.0.2-715

Additional context
Add any other context about the problem here.

@davidpanderson
Copy link
Contributor

I couldn't repro this on Ubuntu 18.04 and BOINC 8.1.0;
the 2nd instance prints ' Another instance of BOINC is running.' and exits.

@kotenok2000
Copy link
Author

It happens when i run it with
cd "/home/user/BOINC" && exec boinc --gui_rpc_port 31417 $@

@davidpanderson
Copy link
Contributor

When the BOINC client starts, it tries to acquire a lock on the file 'lockfile'
in the current directory (i.e. the data directory).

This prevents 2 clients from running in the same data directory.
It doesn't prevent 2 clients from running on the same host.

Are your 2 clients actually running in the same directory?
Check for something like
04-Jan-2025 14:45:08 [---] Data directory: /home/boincadm/boinc_test
at the start of the event log.
Are the directories the same?

@kotenok2000
Copy link
Author

I see this when running another instance in same directory.
Image

For some reason /home/user/BOINC/lockfile was last modified in Aug 28 2023
I am running it in WSL1. Maybe it is the cause?

@davidpanderson
Copy link
Contributor

WSL could be the problem.
There are reports that it doesn't implement fctnl(fd, F_SETLK)
https://stackoverflow.com/questions/59243106/why-fcntl-is-not-blocking-on-f-setlkw-in-wsl
(this is from 2019 and it's talking about WSL 2, but I suspect that problem exists in WSL 1)

File locking probably work in WSL 2. It's critical for many Linux programs.

@AenBleidd AenBleidd closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Planning Jan 5, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Client/Manager Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: Done
Development

No branches or pull requests

3 participants