1. Nohup
Nohup is undoubtedly the way we think first. As the name implies, Nohup's purpose is to let the submitted command ignore the hangup signal. Let's take a look at Nohup's help information:
NOHUP (1) User Commands NOHUP (1) NAME -run a command immune to hangups, with Output to a non-ttysynopsis nohup COMMAND [ARG] ... Nohup optiondescription Run COMMAND, ignoring hangup signals. This Help and exit --version output version information and exit
It can be seen that the use of nohup is very convenient, just add nohup before the command to be processed, standard output and standard errors are redirected to the Nohup.out file. In general, we can add "&" at the end to run the command in the background as well as ">filename 2>&1" to change the default redirect file name.
You can then use mono to execute directly.
Nohup Mono Server.exe >log. out 2>&1 &
If you need to stop the background process first Execute
Ps-aux
Find the appropriate process ID, then kill directly
17969
CentOS Background Execute C # console program