2

I'm using Ubuntu 12.04.

I've tested several scripts that try to get bitcoind running on startup but none have worked out for me.

I'm getting a little bit desperate because I can't even get bitcoind running once I exit my SSH session.

Any clues on how to get bitcoind running once I exit the SSH session?

Best Regards,

6
  • bitcoind -daemon? Otherwise, what version of bitcoind are you using, and what do you see in debug.log? Nov 12, 2013 at 13:34
  • the last line of debug.log. addcon thread interrupt opencon thread interrupt msghand thread interrupt dumpaddr thread stop Flush(false) DBFlush(false) ended 0ms StopNode() net thread interrupt ERROR: CAddrman::Write() : open failed Flushed 11563 addresses to peers.dat 37ms
    – André
    Nov 12, 2013 at 13:46
  • 1
    I tried to run with bitcoind -daemon but onde I exit the SSH session the bitcoind stops
    – André
    Nov 12, 2013 at 13:47
  • @André how do you know it stops?
    – Loourr
    Nov 12, 2013 at 14:14
  • @Loour, when I telnet the host on 8332 not answer anymore. If I enter again the shell is not running anymore. I've also discovered that when I run "bitcoind -daemon &" the process goes to the pid(example) 12994, but one minute later the pid is on 12995. For this reason when I close the SSH this pid go away. Any clues?
    – André
    Nov 12, 2013 at 14:29

1 Answer 1

1

You could use screen or a similar tool like tmux or byoblu. Otherwise use the NOHUP command.

nohup is a POSIX command to ignore the HUP (hangup) signal. The HUP signal is, by convention, the way a terminal warns dependent processes of logout. Output that would normally go to the terminal goes to a file called nohup.out if it has not already been redirected. nohup is a low-level utility simply configuring a command to ignore a signal. As seen below, nohup is very far from being a full-featured batch system solving all the problems of running programs asynchronously.

$ nohup abcd &

$ exit

Alternatives: The screen or tmux command can also detach a process from the current shell. It allows to reattach to the process later on. e.g. the following call will run somescript.sh detached from SIGHUP and in the background:

$ screen -A -m -d -S somename ./somescript.sh &

https://en.wikipedia.org/wiki/Nohup

My advice is to learn to use screen (or tmux) so you can later re-attach the process to the main shell and interact with it.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.