0

Basically what I have to do is run the following command,

./home/pooldaemon/monero-stratum/build/bin/monero-stratum /home/pooldaemon/monero-stratum/config.json

the only disadvantage that this brings with it is that I can't do anything else. So I would like to make it run in the background so that I can do other things on my linux server in the mean time.

For the record I am running Linux Ubuntu 16.04 LTS Server.

I have ran true different solutions but quiet honestly most off them are to far out of my knowledge and understanding off linux.

troylatroy
  • 1,275
Cedric
  • 3
  • 2

3 Answers3

1

If it's ok that your terminal needs to be open, the common way would be to append & to your command (as previously mentioned). But I would not recommend that as you won't be able to use the terminal any more (your command will still promt its output). It's better to forward the output to a file or - if you don't need the output - to "nowhere" by appending > /dev/null > 2>&1 &. The > /dev/null redirects all output to "nowhere", including errors (2>&1) and the last & executes the command in the background.. Try:

./home/pooldaemon/monero-stratum/build/bin/monero-stratum /home/pooldaemon/monero-stratum/config.json > /dev/null 2>&1 &

I think, there is no way to do it any simpler, but using a daemon would be better. Depends on your requirements...

Sim Son
  • 136
  • 6
0

As bodhi.zazin suggested:

./home/pooldaemon/monero-stratum/build/bin/monero-stratum /home/pooldaemon/monero-stratum/config.json &

Another option might be to run it as a daemon process. If using a graphical terminal, this would allow you to close the terminal without aborting the process. You can read a general description of daemon processes on Wikipedia.

Pang
  • 373
0

In addition to redirecting the output, you can protect the process from your logout by using "nohup" as in

nuhup ./home/pooldaemon/monero-stratum/build/bin/monero-stratum /home/pooldaemon/monero-stratum/config.json &

The nohup command traps the hangup signal that processes can receive when a parent process terminates.

jpezz
  • 1,140