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

🐞 Bug - Arch/Manjaro Linux - P2Pool permissions #4108

Open
Rikj000 opened this issue Jan 25, 2023 · 2 comments
Open

🐞 Bug - Arch/Manjaro Linux - P2Pool permissions #4108

Rikj000 opened this issue Jan 25, 2023 · 2 comments

Comments

@Rikj000
Copy link

Rikj000 commented Jan 25, 2023

Issue Description

When installing monero-gui and p2pool from the official repositories on Arch/Manjaro Linux,
then p2pool will run into permission issues.

This happens because:

  • The monero-gui and p2pool packages are installed in the /usr/bin/ folder,
    to which only the root user has write access, not the currently logged in user!
  • The P2PoolManager of monero-gui launches p2pool with the same working directory as what the monero-gui is using.
    So /usr/bin/ is being used as the working directory for p2pool, see:

Fix Proposal

Alter the P2PoolManager to launch p2pool under a different working directory when running on Linux.

Reproduction steps

  1. Install the monero, monero-gui and p2pool packages on Arch/Manjaro from the Official Repositories (community)
  2. Run the monero-gui as the logged in user from CLI with:
    QT_QPA_PLATFORMTHEME=qt5ct monero-wallet-gui %u
  3. Start mining with p2pool through the monero-gui (Configured in the dropdown)
  4. Monitor the permission issues in the CLI output
    • At the start:
      monero-gui-p2pool-permission-issue
    • After a while of running:
      monero-gui-p2pool-peer-list-issue
  5. The monero-gui stays stuck with Network Status Connected + Mining and Mining Status Starting P2Pool
    monero-gui-stuck-starting-p2pool

Note

When starting p2pool manually from CLI as following,
then none of these permission issues occur

# Move to a directory where the currently logged in user has write-permissions
cd ~
# Run p2pool
p2pool
# Stop p2pool with CTRL+C and check if the p2pool.log file got created
ls -alh ~ | grep p2pool.log

Environment

Software Version Source
OS Manjaro Linux x86_64 Official Repositories (core)
Kernel 5.15.89-1-MANJARO Official Repositories (core)
QT5 5.15.8+kde+r174-1 Official Repositories (extra)
Monero 0.18.1.2-3 Official Repositories (community)
Monero GUI 0.18.1.2-2 Official Repositories (community)
P2Pool 2.7-1 Official Repositories (community)

Linked issues

@selsta
Copy link
Collaborator

selsta commented Feb 2, 2023

p2pool integration was built with the portable binaries from getmonero.org in mind.

I thought about adding this for package managers: #3926

Alter the P2PoolManager to launch p2pool under a different working directory when running on Linux.

What would you suggest here?

@Rikj000
Copy link
Author

Rikj000 commented Feb 4, 2023

Alter the P2PoolManager to launch p2pool under a different working directory when running on Linux.

What would you suggest here?

To modify the m_p2poolPath variable after the m_p2pool variable has been set in the P2PoolManager's constructor.

Something like:

#elif defined(Q_OS_UNIX)
    m_p2poolPath = QApplication::applicationDirPath();
    m_p2pool = m_p2poolPath + "/p2pool";
    m_p2poolPath = QString::fromStdString(tools::get_default_data_dir()) + "/p2pool/"; // A.k.a. m_p2poolWorkingDir

With above change,
the m_p2poold->setWorkingDirectory(m_p2poolPath); line of the P2PoolManager::start() function,
should initialize the p2pool process under a write-able p2pool directory,
inside the already existing ~/.bitmonero folder.

However I didn't check the other occurrences/usages of m_p2poolPath in the rest of the P2PoolManager thoroughly.
To prevent breaking anything, it might be good to introduce a new variable for this, e.g. m_p2poolWorkingDir,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants