fancoder / cryptonote-universal-pool

Mining pool for all CryptoNote based coins such as Bytecoin, duckNote, Monero, and Fantomcoin.
http://cryptonotemining.org
GNU General Public License v2.0
335 stars 308 forks source link

Running pool via systemd on Ubuntu 16.04 - Refused port connections #121

Closed ghost closed 6 years ago

ghost commented 6 years ago

My pool works ok but I need to run it via systemd on Ubuntu 16.04. I've tried it with this .service but pool does not receive incoming connections on mining ports. I've done the same thing with daemon and wallet and they work ok. With this pool I can't do it the same, incoming connections are refused.

SERVICE

[[Unit]
Description=Pool
After=network.target

[Service]
User=user
Group=user
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=pool
Restart=always
RestartSec=30
Environment=REDIS_HOST=localhost
WorkingDirectory=/home/user/pool
ExecStart=/usr/bin/node /home/user/pool/init.js

[Install]
WantedBy=multi-user.target

When I run systemctl status pool it shows this, It seems that the pool crashes but it still running... when I try to connect my miner software, the connection is refused.

sudo systemctl status pool.service
● pool.service - Pool
   Loaded: loaded (/etc/systemd/system/pool.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

May 29 01:08:12 localhost.localdomain pool[47721]:     at Function.Module._load (module.js:301:12)
May 29 01:08:12 localhost.localdomain pool[47721]:     at Module.require (module.js:354:17)
May 29 01:08:12 localhost.localdomain pool[47721]:     at require (internal/module.js:12:17)
May 29 01:08:12 localhost.localdomain pool[47721]:     at Object.<anonymous> (/home/user/pool/node_modules/bignum/iMay 29 01:08:12 localhost.localdomain pool[47721]:     at Module._compile (module.js:410:26)
May 29 01:08:12 localhost.localdomain pool[47721]:     at Object.Module._extensions..js (module.js:417:10)
May 29 01:08:12 localhost.localdomain pool[47721]:     at Module.load (module.js:344:32)
May 29 01:08:12 localhost.localdomain pool[47721]: 2018-05-29 01:08:12 [master] Pool fork 2 died, spawning replacement worker...
May 29 01:08:13 localhost.localdomain systemd[1]: Stopping Pool...
May 29 01:08:13 localhost.localdomain systemd[1]: Stopped Pool.
ghost commented 6 years ago

works fine just replacing /usr/bin/node (v4) by /usr/bin/local/node (v0.10.4) the fist one run an incorrect version of node

because I installed node version -> 0.10 to run the pool

sudo npm install -g n
# use node's version 0.10.^
sudo n 0.10