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,

closed as off-topic by DanBig, voretaq7 Nov 12 '13 at 17:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – DanBig, voretaq7
If this question can be reworded to fit the rules in the help center, please edit the question.


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 or ask your own question.