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查看系统进程


©著作权归作者所有:来自51CTO博客作者mob604756e6a4ae的原创作品,如需转载,请注明出处,否则将追究法律责任

更多相关文章

  1. 几个小问题
  2. docker进程分析
  3. 闲聊僵尸进程
  4. 如何给脚本写一个守护进程?
  5. 2021-2-25:对于 Java MMAP,如何查看文件映射脏页,如何统计MMAP的内
  6. Flash是真的要退役了,一代热门技术就此终结
  7. 如何解决U盘老是被占用不能退出的问题
  8. Mac OSX 开机启动应用
  9. 【我的Linux,我做主!】Docker容器技术基础入门

随机推荐

  1. 学习iPhone开发中 sqlite3的使用
  2. MySQL输入错误后如何取消
  3. Sql Server选择不同的记录和OrderBy NEWI
  4. “AND ..和... and”和“and(and .. and)”
  5. oracle:使用cmd命令在远程oracle服务器上
  6. MySQL基础入门学习【7】查询表达式解析 S
  7. sql 设置主键自增从1开始
  8. 用sql语句如何实现小数位数四舍六入,小数
  9. Mysql查询优化——Explain使用
  10. 检索SQL语句的输出参数