Skip to content

Commit

Permalink
Create SYSTEMD.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed Apr 20, 2023
1 parent 5f18eed commit 21f8271
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions docs/SYSTEMD.MD
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
```

0 comments on commit 21f8271

Please sign in to comment.