How to start /usr/bin/bitcoind on boot?

Posted by André on Ask Ubuntu See other posts from Ask Ubuntu or by André
Published on 2013-11-12T10:35:29Z Indexed on 2013/11/12 16:00 UTC
Read the original article Hit count: 427

Filed under:

I'm trying to get /usr/bin/bitcoind to start on boot but without success.

I have this script on /etc/init/bitcoind.conf

description "bitcoind"

start on filesystem
stop on runlevel [!2345]
oom never
expect daemon
respawn
respawn limit 10 60 # 10 times in 60 seconds

script
user=andre
home=/home/$user
cmd=/usr/bin/bitcoind
pidfile=$home/.bitcoin/bitcoind.pid
# Don't change anything below here unless you know what you're doing
[[ -e $pidfile && ! -d "/proc/$(cat $pidfile)" ]] && rm $pidfile
[[ -e $pidfile && "$(cat /proc/$(cat $pidfile)/cmdline)" != $cmd* ]] && rm $pidfile
exec start-stop-daemon --start -c $user --chdir $home --pidfile $pidfile --starta $cmd -b -m
end script

After creating this script I've run the command: sudo initctl reload-configuration

When I restart Ubuntu the "bitcoind" does not start. I only can start "bitcoind" running manually the command: sudo start bitcoind

Any clues on how to start "bitcoind" on boot?

© Ask Ubuntu or respective owner

Related posts about boot