CentOS Background Execute C # console program

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.