Disable nginx Process
Of course, it's just a simple introduction to a command.
Nginx creates a working process by default.
root 2713 1 0 07:56 ? 00:00:00 nginx: master process ../sbin/nginxnobody 2714 2713 0 07:56 ? 00:00:00 nginx: worker process
Modify worker_processes = 10 to create multiple processes.
#user nobody;worker_processes 10;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;pid logs/nginx.pid;events { worker_connections 1024;}
fuhui@ubuntu:/usr/local/nginx$ ps -ef | grep 'nginx' root 2713 1 0 07:56 ? 00:00:00 nginx: master process ../sbin/nginxnobody 2747 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2748 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2749 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2750 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2751 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2752 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2753 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2754 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2755 2713 0 08:00 ? 00:00:00 nginx: worker processnobody 2756 2713 0 08:00 ? 00:00:00 nginx: worker processfuhui 2852 2332 0 08:29 pts/6 00:00:00 grep --color=auto nginx
Incorrect execution method: fuhui @ ubuntu:/usr/local/nginx $ sudo ps-ef | grep 'nginx' | awk '{kill-9 $2 }'
Correct execution method: fuhui @ ubuntu:/usr/local/nginx $ sudo kill 'ps-ef | grep 'nginx' | awk '{print $2 }''
To kill all Nginx Processes
kill $(ps aux | grep '[n]ginx' | awk '{print $2}')
The effect is the same as that of $ ().