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 Answer 1

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.

7
  • 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. Apr 29, 2019 at 3:50
  • Hey... Please respond Apr 29, 2019 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, 2019 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. Apr 29, 2019 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, 2019 at 6:24

You must log in to answer this question.

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