How centOS flexible process management services

 1. Insert the program up and running, and close the session when the program is still running.

  

nohup node index.js &

(Plus the head nohup , represents the corresponding process continues to run after you exit the account or close the terminal; tails & representation in the background script), after the command is executed, returns a PID, which is the process ID, P represents progress .

 

2. View the list of processes.

netstat -npl

We can see the process running on the server after the execution:

(See 3000 port is a node process to take up, PID is 10061)

 

3. kill the process

 Now that we know the process PID, you can try to end it, the end of the command is as follows:

  

kill -9 10061

(Which, -9 reason for the number 9, because Linux signal, nine kills on behalf of the meaning)

 

This basic realization of the management server process.

 

Guess you like

Origin www.cnblogs.com/zhangnan35/p/11218000.html