Skip to content

P2poolv2 process management - #30

Closed
R27-pixel wants to merge 16 commits into
p2poolv2:mainfrom
R27-pixel:p2poolv2-process-management
Closed

R27-pixel wants to merge 16 commits into
p2poolv2:mainfrom
R27-pixel:p2poolv2-process-management

Conversation

@R27-pixel

Copy link
Copy Markdown
Contributor

Summary

Adds start/stop/restart process management for the p2poolv2 node, mirroring the Bitcoin Core process management from #.

What's included

  • New p2poolv2_path setting (falls back to PATH lookup when unset, same as bitcoind_path)
  • p2pool_process_manager on App reusing the existing generic ProcessManager, with start/stop/restart/poll/shutdown
  • Spawns the node with --config <p2pool_conf_path>, matching the real systemd unit's ExecStart
  • New "Process" tab on P2Pool Status with [s] Start, [t] Stop, [r] Restart
  • New "P2Poolv2 executable" field in Settings
  • p2poolv2 now shuts down gracefully alongside Bitcoin Core on quit

Testing

  • Unit tests for command construction, missing-executable failure, idle-stop no-op
  • Unit tests for the new Settings field and Process tab key handling
  • Render test for the Process tab
image

@R27-pixel
R27-pixel marked this pull request as draft July 25, 2026 14:58
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

@R27-pixel

Copy link
Copy Markdown
Contributor Author

Architecture Update

Since this PR was originally opened, the intended process-management architecture for PDM has changed following maintainer discussion.

The current implementation gives PDM direct ownership of the P2Poolv2 process through start/stop/restart controls and ProcessManager. We have since decided that PDM should not own the lifetime of the P2Poolv2 node.

The direction is to run P2Poolv2 as a systemd user service, with the service manager owning the process lifecycle. PDM will instead connect to an already-running node through its API and provide the relevant status and interaction functionality.

This means:

  • P2Poolv2 continues running independently when PDM exits.
  • PDM connects to an already-running P2Poolv2 node through its API.
  • Process lifecycle is owned by the service manager rather than PDM.
  • Docker/Podman remains a possible deployment option for the future.

This direction is being tracked in p2poolv2#289.

Given this, I think it's cleaner to close this PR and implement the service-based approach separately rather than refactor the current implementation. @pool2win, please correct me if I've misunderstood the intended direction before I close it.

@pool2win

Copy link
Copy Markdown
Contributor

Agreed. Closing in favour of PR 289 as mentioned in the last comment.

@pool2win pool2win closed this Aug 27, 2026
@R27-pixel
R27-pixel deleted the p2poolv2-process-management branch September 9, 2026 18:46
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

Successfully merging this pull request may close these issues.

2 participants