1、概念

  计算机中,一个正在执行的程序或命令,被叫做“进程”(process)。

  启动之后一直存在、常驻内存的进程,一般被称作“服务”(service)。

2、systemctl(Centos7为例):system control的意思,系统控制

  2.1、基础语法

    systemctl start|stop|restart|status 服务名

    systemctl能够操作的服务名称位于 /usr/lib/systemd/system 目录

    

Linux中的进程和服务_centos

 

    查看防火墙服务  

    systemctl status firewalld

    

Linux中的进程和服务_centos_02

 

     停止防火墙服务

    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

    

Linux中的进程和服务_centos_03