kill所有nginx进程
查看所有nginx进程
[root@iZ2zeimdylgs1p79hmwbayZ ~]# ps -ef | grep nginx
root 1297 3334 0 15:54 pts/1 00:00:00 grep --color=auto nginx
root 1419 1364 0 2月08 ? 00:00:00 s6-supervise nginx
root 1423 1419 0 2月08 ? 00:00:00 nginx: master process nginx -g daemon off;
100 1425 1423 0 2月08 ? 00:00:07 nginx: worker process
root 23229 13177 0 2月23 ? 00:00:00 runsv nginx
root 23231 23229 0 2月23 ? 00:00:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
polkitd 23233 23231 0 2月23 ? 00:00:00 nginx: worker process
polkitd 23234 23231 0 2月23 ? 00:00:00 nginx: worker process
polkitd 23235 23231 0 2月23 ? 00:00:00 nginx: worker process
polkitd 23236 23231 0 2月23 ? 00:00:00 nginx: worker process
polkitd 23237 23231 0 2月23 ? 00:00:00 nginx: worker process
polkitd 23238 23231 0 2月23 ? 00:00:00 nginx: worker process
polkitd 23239 23231 0 2月23 ? 00:00:00 nginx: worker process
polkitd 23240 23231 0 2月23 ? 00:00:01 nginx: worker process
polkitd 23242 23231 0 2月23 ? 00:00:02 nginx: worker process
删掉所有nginx进程
kill -9 $(ps aux | grep 'nginx' | grep -v grep | tr -s ' '| cut -d ' ' -f 2)
原理
https://www.cnblogs.com/whm-blog/p/10817843.html