Compare commits
2 Commits
b4a284efd1
...
8f7cca95fe
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f7cca95fe | |||
| 8f0463687e |
4
debian/p2pool.service
vendored
4
debian/p2pool.service
vendored
@@ -15,6 +15,10 @@ StandardOutput=journal
|
|||||||
StandardError=journal
|
StandardError=journal
|
||||||
SyslogIdentifier=p2pool
|
SyslogIdentifier=p2pool
|
||||||
|
|
||||||
|
# Resource limits
|
||||||
|
LimitMEMLOCK=infinity
|
||||||
|
AmbientCapabilities=CAP_IPC_LOCK
|
||||||
|
|
||||||
# Security hardening
|
# Security hardening
|
||||||
NoNewPrivileges=true
|
NoNewPrivileges=true
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
|
|||||||
33
debian/postinst
vendored
33
debian/postinst
vendored
@@ -13,13 +13,13 @@ if ! getent passwd p2pool >/dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create data directory
|
# Create data directory
|
||||||
mkdir -p /var/lib/p2pool
|
mkdir -p /var/lib/p2pool/data-api
|
||||||
chown p2pool:p2pool /var/lib/p2pool
|
chown -R p2pool:p2pool /var/lib/p2pool
|
||||||
chmod 750 /var/lib/p2pool
|
chmod -R 750 /var/lib/p2pool
|
||||||
|
|
||||||
# Create example params.conf if it doesn't exist
|
# Create example params.conf if it doesn't exist
|
||||||
if [ ! -f /var/lib/p2pool/params.conf ]; then
|
if [ ! -f /var/lib/p2pool/params.conf ]; then
|
||||||
cat > /var/lib/p2pool/params.conf << 'EOF'
|
cat > /var/lib/p2pool/params.conf << 'CONF'
|
||||||
# P2Pool Configuration File
|
# P2Pool Configuration File
|
||||||
# Edit this file with your settings and restart the service
|
# Edit this file with your settings and restart the service
|
||||||
|
|
||||||
@@ -28,6 +28,12 @@ host = 127.0.0.1
|
|||||||
rpc-port = 18081
|
rpc-port = 18081
|
||||||
zmq-port = 18083
|
zmq-port = 18083
|
||||||
|
|
||||||
|
# Use SSL for RPC connection
|
||||||
|
# rpc-ssl = true
|
||||||
|
|
||||||
|
# RPC credentials (if applicable)
|
||||||
|
# rpc-login = username:password
|
||||||
|
|
||||||
# Your Monero wallet address (REQUIRED)
|
# Your Monero wallet address (REQUIRED)
|
||||||
wallet = YOUR_MONERO_WALLET_ADDRESS
|
wallet = YOUR_MONERO_WALLET_ADDRESS
|
||||||
|
|
||||||
@@ -46,11 +52,11 @@ loglevel = 3
|
|||||||
# mini = true
|
# mini = true
|
||||||
|
|
||||||
# Merge mining (optional - uncomment to enable Tari merge mining)
|
# Merge mining (optional - uncomment to enable Tari merge mining)
|
||||||
# merge-mine = tari://TARI_NODE_IP:18102 TARI_WALLET_ADDRESS
|
# merge-mine = tari://TARI_NODE_IP:18142 TARI_WALLET_ADDRESS
|
||||||
|
|
||||||
# Stratum server (for miners to connect)
|
# Stratum server (for miners to connect)
|
||||||
# stratum = 0.0.0.0:3333
|
# stratum = 0.0.0.0:3333
|
||||||
EOF
|
CONF
|
||||||
chown p2pool:p2pool /var/lib/p2pool/params.conf
|
chown p2pool:p2pool /var/lib/p2pool/params.conf
|
||||||
chmod 640 /var/lib/p2pool/params.conf
|
chmod 640 /var/lib/p2pool/params.conf
|
||||||
fi
|
fi
|
||||||
@@ -64,9 +70,22 @@ chmod 750 /var/log/p2pool
|
|||||||
chown root:root /opt/p2pool/p2pool
|
chown root:root /opt/p2pool/p2pool
|
||||||
chmod 755 /opt/p2pool/p2pool
|
chmod 755 /opt/p2pool/p2pool
|
||||||
|
|
||||||
# Reload systemd
|
# Reload systemd and handle service restart on upgrade
|
||||||
if [ -d /run/systemd/system ]; then
|
if [ -d /run/systemd/system ]; then
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
|
# On upgrade: restart service if it was enabled
|
||||||
|
if [ "$1" = "configure" ] && [ -n "$2" ]; then
|
||||||
|
# $2 is the previously installed version (only set on upgrade)
|
||||||
|
if systemctl is-enabled --quiet p2pool.service 2>/dev/null; then
|
||||||
|
echo "Restarting p2pool service after upgrade..."
|
||||||
|
systemctl start p2pool.service || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# Note: On fresh install, service is NOT auto-enabled or auto-started
|
||||||
|
# Users should manually enable the service:
|
||||||
|
# systemctl enable p2pool.service
|
||||||
|
# systemctl start p2pool.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
30
debian/prerm
vendored
30
debian/prerm
vendored
@@ -1,17 +1,33 @@
|
|||||||
#!/bin/sh
|
case "$1" in
|
||||||
set -e
|
upgrade)
|
||||||
|
# Stop service only during upgrade, keep enabled state
|
||||||
# Stop and disable service if running
|
if [ -d /run/systemd/system ]; then
|
||||||
if [ -d /run/systemd/system ]; then
|
if systemctl is-active --quiet p2pool.service; then
|
||||||
|
echo "Stopping p2pool service for upgrade..."
|
||||||
|
systemctl stop p2pool.service
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
remove|deconfigure)
|
||||||
|
# Stop and disable service during removal
|
||||||
|
if [ -d /run/systemd/system ]; then
|
||||||
if systemctl is-active --quiet p2pool.service; then
|
if systemctl is-active --quiet p2pool.service; then
|
||||||
echo "Stopping p2pool service..."
|
echo "Stopping p2pool service..."
|
||||||
systemctl stop p2pool.service
|
systemctl stop p2pool.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if systemctl is-enabled --quiet p2pool.service 2>/dev/null; then
|
if systemctl is-enabled --quiet p2pool.service 2>/dev/null; then
|
||||||
echo "Disabling p2pool service..."
|
echo "Disabling p2pool service..."
|
||||||
systemctl disable p2pool.service
|
systemctl disable p2pool.service
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
failed-upgrade)
|
||||||
|
# Do nothing on failed upgrade
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "prerm called with unknown argument \`$1'" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
Reference in New Issue
Block a user