Fail on start bitcored service


(Eugene Krevenets) #1

I’m trying to setup service, according to https://bitcore.io/guides/upstart-daemon/

But on

# service bitcored start

got error:

Failed to start bitcored.service: Unit bitcored.service failed to load: No such file or directory.

in same time

# bitcored
[2015-12-29T18:31:06.026Z] info: Starting bitcoind
[2015-12-29T18:31:10.086Z] info: Bitcoin Daemon Ready
[2015-12-29T18:31:10.086Z] info: Starting db
[2015-12-29T18:31:10.240Z] info: Bitcoin Database Ready
[2015-12-29T18:31:10.241Z] info: Starting address
[2015-12-29T18:31:10.249Z] info: Starting web
and so on...

works well


(Jspeigner) #2

I see the same issue when trying to setup as service. Does anyone have this working with these setup instructions?


(Chris Kleeschulte) #3

The bitcored.conf file is an upstart script. If I am reading your provided output correctly, you might be running a system with systemd instead of upstart? Upstart is mostly used on Ubuntu systems, but Systemd seems to be very popular elsewhere such as Fedora? and Debian.

Maybe you are using systemd? If so, using those directions won’t work. I would be happy to provide you a systemd service script if this is the case.


(Eugene Krevenets) #4

Thanks for replay! I’m working with Ubuntu 15.10. It seems that According to documentation https://wiki.ubuntu.com/SystemdForUpstartUsers from 15.04 Ubuntu uses systemd by default. So I will be very happy to get systemd service script :slight_smile:


(Chris Kleeschulte) #5

here is a suitable script that I am using for a CentOS system on Microsoft Azure. CentOS uses systemd as well, so this should work ok. Just substitute the user and home directory where bitcored is run.

[Unit]
Description=bitcored.service
After=network.target

[Service]
Type=simple
User=bitcore
Environment="PATH=$PATH:/home/bitcore/.nvm/versions/node/v4.2.4/bin"
ExecStart=/home/bitcore/.nvm/versions/node/v4.2.4/bin/bitcored
ExecReload=/bin/kill -2 $MAINPID
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.agent


(Eugene Krevenets) #6

thanks for replay, it works great :slight_smile:

but I’ve made some changes for me:

[Unit]
Description=bitcored.service
After=network.target

[Service]
Type=simple
User=bitcore
Environment="PATH=$PATH:/home/bitcore/.nvm/versions/node/v4.2.4/bin"
ExecStart=/root/.nvm/versions/node/v4.2.4/bin/node /usr/lib/node_modules/bitcore/bin/bitcored
ExecReload=/bin/kill -2 $MAINPID
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

(Ankit Singhal) #7

i have Ubuntu LTS 16.04 and i tried all way to get bitcored up and running on boot. it doesn’t after all sort of attempts. i have copied your changed systemd content to my “etc/systemd/system/bitcored.service” and now there is no error when i hit “service bitcored start” on terminal but nothing works.
when i manually type bitcored on termial it works. please help what i am doing wrong.