0

I'm trying to send to the background "bitcoind".

$ screen bitcoind -daemon &
[1] 5289

Then I query for this process PID and the PID have changed

$ ps -ef | grep bitcoin
someuser     4003     1 14 16:16 ?        00:00:39 bitcoind -daemon
someuser     5384  3648  0 16:20 pts/0    00:00:00 grep --color=auto bitcoin

Then I do:

$ screen -r
There is no screen to be resumed.

I'm trying to get this "bitcoind" program to the background but for some reason the PID cahnges and I think this is the cause of screen not working. Can someone give me some clues on how to get this process to the background so when I exit the SSH sesion the bitcoind will continue to run?

I'm using Ubuntu 12.04

Best Regards,

1 Answer 1

3

I assume by bitcoind you mean this bitcoind.

Let's see what you are doing:

  • You are starting a screen which usually will start the following program in it.
  • As a program you pass bitcoind -daemon. This will start bitcoind in the background (usually by using fork(2)).
  • And you pass & to send the screen into background of your shell. The PID you see is the PID your shell started, the one of the screen.

As you passed -daemon to bitcoind, it has moved itself into background. As there is no more foreground process visible to screen it has terminated itself. Thus you do not see the 5289 PID at all and your bitcoind process has a PID you did not expect.

TL;DR: just call bitcoind -daemon and it should go in background.

Not the answer you're looking for? Browse other questions tagged .