bitpay / bitcore

A full stack for bitcoin and blockchain-based applications
https://bitcore.io/
MIT License
4.86k stars 2.09k forks source link

How to create systemd startup script? #1504

Open AVKarelin opened 6 years ago

AVKarelin commented 6 years ago

I have the last bitcore. I cretae user bitcore, make mynode with "bitcore create mynode" and "bitcore install insight-api". So I have data in /home/bitcore/mynode/data and bitcore-node.json in /home/bitcore/mynode I make script for systemd

[Unit]
Description=Bitcored service
Requires=network.target

[Service]
Type=simple
Environment="PATH=$PATH:/home/bitcore/.nvm/versions/node/v4.8.7/bin"
WorkingDirectory=/home/bitcore/mynode
ExecStart=/home/bitcore/.nvm/versions/node/v4.8.7/lib/node_modules/bitcore/node_modules/bitcore-node/bin/bitcoind
ExecReload=/bin/kill -2 $MAINPID
killmode=process
Restart=on-failure
RestartSec=15
User=bitcore
PermissionsStartOnly=true

[Install]
WantedBy=multi-user.target

But this script don't run bitcored in /home/bitcore/mynode and dont run an api service.

daniel-farina commented 6 years ago

@Shmebulok did you ever findout the proper way to run bitcore with systemd?