JAVA和Nginx 教程大全

网站首页 > 精选教程 正文

基于CentOS8Linux运维教程-Linux服务进程管理

wys521 2024-09-21 05:01:08 精选教程 42 ℃ 0 评论

Linux服务进程管理


  • 服务管理
  • 进程管理



准备工作- 安装nginx服务

nginx 网站服务器 端口 80

yum -y install nginx 


服务管理-systemctl

7 : systemctl 6: service

启动 : systemctl start nginx

停止: systemctl stop nginx

重启: systemctl restart nginx

重载: systemctl reload nginx

状态 : systemctl status nginx

开机自启 : systemctl enable nginx

开机禁止: systemctl disable nginx


服务验证


netstat 查看端口,tcp: -anlpt , udp: -anlpu

[root@myserver ~]# netstat -anlpt | grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      6416/nginx: master  
tcp6       0      0 :::80                   :::*                    LISTEN      6416/nginx: master  
?


进程管理

ps 查看进程状态

[root@myserver ~]# ps aux |grep nginx 
root        6416  0.0  0.5 118672  9920 ?        Ss   09:10   0:00 nginx: master process /usr/sbin/nginx
nginx       6447  0.0  0.4 150020  9000 ?        S    09:10   0:00 nginx: worker process
root        6635  0.0  0.0  12108  1088 pts/0    S+   09:15   0:00 grep --color=auto nginx
?
###
运行用户、进程id
?

kill 停止进程, kill pid , -9 强制停止 -15 发送信号稳定停止

kill pid
kill -9 123
kill -15 123
killall nginx   ## 将nginx服务的所有进程停止

top查看系统进程



#Linux# #CentOS# #运维# #程序员#

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表