Linux中的进程和服务

1、概念
  计算机中,一个正在执行的程序或命令,被叫做“进程”(process)。
  启动之后一直存在、常驻内存的进程,一般被称作“服务”(service)。
2、systemctl(Centos7为例):system control的意思,系统控制
  2.1、基础语法
    systemctl start|stop|restart|status 服务名
    systemctl能够操作的服务名称位于 /usr/lib/systemd/system 目录
    

 

    查看防火墙服务  

    systemctl status firewalld

    

 

     停止防火墙服务

    systemctl stop firewalld

    启动防火墙服务

    systemctl start firewalld

    重启防火墙服务

    systemctl restart firewalld

  2.2、systemctl设置后台服务的自启动配置

命令 描述
systemctl list-unit-files 查看服务开机启动状态
systemctl disable service_name 关掉指定服务的自动启动
systemctl enable service_name 开启指定服务的自动启动
 
    查看服务开机启动状态:systemctl list-unit-files
    

 

 

 

posted @   张念柯  阅读(90)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【.NET】调用本地 Deepseek 模型
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
点击右上角即可分享
微信分享提示