使用systemctl命令控制软件的启动和关闭
Linux系统很多软件(内置或第三方)均支持使用systemctl
命令控制:启动、停止、开机自启,能够被systemctl
管理的软件,一般也被称之为:服务
语法:
systemctl start | stop | status | enable | disable 服务名
- start 启动
- stop 关闭
- status 查看状态
- enable 开启开机自启
- disable 关闭开机自启
系统内置的服务比较多
- NetworkManager,主网络服务
- network,副网络服务
- firewalld,防火墙服务
- sshd,ssh服务(FinalShell远程登录Linux使用的就是这个服务)
除了内置的服务以外,部分第三方软件安装后也可以以systemctl
进行控制
yum install -y ntp
,安装ntp软件
可以通过ntpd
服务名,配合systemctl
进行控制
yum install -y httpd
安装apache服务器软件,可以通过httpd服务名,配合systemctl
进行控制
这两个软件都是安装后自动集成到systemctl
中,可以用systemctl
进行控制,对于没有自动集成的软件需要手动添加