forked from SChernykh/p2pool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
## Setting up P2Pool as a systemd service (Linux) | ||
|
||
With this config, P2Pool will run as a service with redirected I/O. It uses `p2pool` user which you should setup beforehand. | ||
|
||
You can execute console commands by running `echo "status" > /run/p2pool/p2pool.control` | ||
|
||
### p2pool.service | ||
``` | ||
[Unit] | ||
Description=p2pool daemon | ||
After=network-online.target systemd-modules-load.service monerod.service | ||
Wants=network-online.target systemd-modules-load.service monerod.service | ||
Requires=p2pool.socket | ||
[Service] | ||
Type=exec | ||
Sockets=p2pool.socket | ||
StandardInput=socket | ||
StandardOutput=journal | ||
StandardError=journal | ||
# /usr/local/bin/p2pool.sh simply invokes the p2pool executable with your chosen command-line options. | ||
ExecStart=/usr/local/bin/p2pool.sh | ||
TimeoutStopSec=60 | ||
# Run as p2pool:p2pool | ||
User=p2pool | ||
Group=p2pool | ||
WorkingDirectory=/var/lib/p2pool | ||
[Install] | ||
WantedBy=multi-user.target | ||
``` | ||
|
||
### p2pool.socket | ||
``` | ||
# FIFO socket for controlling p2pool daemon | ||
[Unit] | ||
Description=Command FIFO for p2pool daemon | ||
[Socket] | ||
ListenFIFO=/run/p2pool/p2pool.control | ||
DirectoryMode=0755 | ||
SocketMode=0666 | ||
SocketUser=p2pool | ||
SocketGroup=p2pool | ||
RemoveOnStop=true | ||
``` |