using tor is better option.
if you want tor or bitcoin-cli or bitcoind to start automatically when ubuntu restart, you can try this:
sudo systemctl enable tor.service or
update-rc.d tor enablehere is the way to start up bitcoind automatically if your ubuntu restarts/reboot:
Configuration files for upstart are stored under /etc/init/*.conf. this one is for bitcoind:
https://github.com/bitcoin/bitcoin/blob/2d782ab2ce30bf106e34cd3288c9082ac04022f9/contrib/init/bitcoind.confso, it should be in your computer here: /etc/init/bitcoind.conf
then run: sudo initctl reload-configuration
sudo service bitcoind start
but generally if you use linux, you can also prevent any process, including bitcoin-cli, to overtake consumption of your CPU and block your computer.
cpulimit is a simple program which attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time).
I just used in debian: sudo apt-get install cpulimit
but if you can't get it, then:
wget -O cpulimit.zip
https://github.com/opsengine/cpulimit/archive/master.zipunzip and cd cpulimit-xxx
./configure
make
then maybe you need to copy it to /usr/bin
use
top or
htop to list all processes and find bitcoin-cli, let's say
PID is 1234cpulimit command is:
cpulimit -p 1234 -l 50this means, bitcoin can use maximum 50% of your CPU.
you can use also the name of the process:
cpulimit -e bitcoin-cli -l 50you can use tmux to keep proces running in the background even if you close the terminal/console:
sudo apt-get install tmuxtmux #to start tmux session
start bitcoin-cli, I suppose it is
sudo service bitcoin-cli startthen you can close terminal running tmux, bitcoin-cli will continue to run, or you can just go out from tmux, bitcoin-cli will continue to run in the backgroung.
you can do the same with cpulimit inside of tmux.
to go out only from tmux:
ctrl+b d or
ctrl+b :detach