0

I just run bitcoind in centOS server. I run the following command

nohup ./bitcoind > out & disown

Then I exit the SSH terminal, and the process is automatically closed. Is there any way to make this process run as a background process, after closing ssh?

Os: CentOS-7

1

CentOS version 7 or newer I suppose?

This looks like an effect of systemd session management: when the user's session ends, any processes belonging to that session are automatically terminated.

If that's the cause, the solution requires two steps. First, your user account needs a permission to let processes linger on after the user's session ends:

loginctl enable-linger <username>

Granting that permission may or may not require admin rights, depending on choices made by the system administrator and/or default settings of a particular Linux distribution.

Then you'll need to use systemd-run instead of the old nohup to start your long-term background process.

  • Hi. Thanks for answering, The command "loginctl enable-linger <username>" is working. But I the process is automatically stop when the terminal is closed. Have any suggestion. – salman faris Apr 29 at 3:50
  • Hey... Please respond – salman faris Apr 29 at 5:49
  • According to this question, if your CentOS is not up to date with patches, it might be a known bug in systemd. Also, if you are not the server administrator, the admin may have taken steps to stop regular users leaving lingering processes around; if that's the case, you'll need to talk to that administrator. – telcoM Apr 29 at 6:01
  • The admin already give the permission for lingering processes. But I the process is automatically stop when the terminal is closed. Have any suggestion. – salman faris Apr 29 at 6:14
  • If the CentOS system is up to date and you already used systemd-run instead of nohup after enabling lingering, then I'm out of ideas, sorry. – telcoM Apr 29 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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