Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Chick on July 03, 2011, 01:01:55 AM



Title: Making bitcoind run in the background?
Post by: Chick on July 03, 2011, 01:01:55 AM
Hey guys, what would be the best way to make bitcoind run on startup and run in the background? Currently, I'm running it through a ssh window and whenever I close the ssh client, the daemon goes down.

I was thinking about setting up a screen for it, is this a good idea? I did see a start-up (http://forum.bitcoin.org/?topic=965.0) script that I could use.


Title: Re: Making bitcoind run in the background?
Post by: sublimnl on July 03, 2011, 01:03:43 AM
Start up script is the best way... especially if you are looking for it to run on boot in case the machine goes down..


Title: Re: Making bitcoind run in the background?
Post by: bitplane on July 03, 2011, 01:55:39 AM
If you want to start it manually via ssh, press ctrl+z to suspend the process, then type bg to resume it in the background. Finally disown to detach the background process from the shell, then you can safely disconnect your ssh session.

But yeah, running it on startup via cron is the best way. Run crontab -e as the user you want to run bitcoind as and add an @reboot line. See man cron for more info.


Title: Re: Making bitcoind run in the background?
Post by: BCEmporium on July 03, 2011, 02:00:47 AM
Actually you can use monit to start and monitor it. It already bundles with a startup script for monit and 1 minute after it fires up bitcoind


Title: Re: Making bitcoind run in the background?
Post by: Chick on July 03, 2011, 02:31:12 AM
If you want to start it manually via ssh, press ctrl+z to suspend the process, then type bg to resume it in the background. Finally disown to detach the background process from the shell, then you can safely disconnect your ssh session.

But yeah, running it on startup via cron is the best way. Run crontab -e as the user you want to run bitcoind as and add an @reboot line. See man cron for more info.

The startup script seemed to work well. Works flawlessly when shutting down and restarting.


Title: Re: Making bitcoind run in the background?
Post by: SeriousWorm on July 03, 2011, 01:27:01 PM
uh, on linux:

<program name> &

.. runs it in the background.


Title: Re: Making bitcoind run in the background?
Post by: WakiMiko on July 03, 2011, 03:44:43 PM
just start it with -daemon and it will continue running even if you log out of your ssh session


Title: Re: Making bitcoind run in the background?
Post by: danystatic on December 09, 2013, 05:32:02 PM
But how can it be monitor, it is running in background and after some time it stops and shutsdown.... service is down.

And have to manually restart it.


Title: Re: Making bitcoind run in the background?
Post by: kjj on December 10, 2013, 03:41:21 AM
just start it with -daemon and it will continue running even if you log out of your ssh session

This is the correct answer.

If you are having problems with it crashing, consider getting a better box.  :)  Or a cron job that checks to see if it is running and restarts it as necessary.