First, the control of system services
1.systemd
System initialization program, the first process that the system starts, the PID is 1
2.systemctl command
Systemctl List-units # #列出当前系统服务的状态
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/8F/97/wKioL1jmDtWxYI1UAAFeXVYYfl8343.png "title=" Screenshot from 2017-04-05 21-28-17.png "alt=" Wkiol1jmdtwxyi1uaafexvyyfl8343.png "/>
Systemctl List-unit-files # #列出服务的开机状态
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/8F/99/wKiom1jmDuaAxHN-AADO45H2hd0453.png "title=" Screenshot from 2017-04-05 21-28-39.png "alt=" Wkiom1jmduaaxhn-aado45h2hd0453.png "/>
Systemctl Status sshd # #查看指定服务的状态
Systemctl Stop sshd # #关闭指定服务
Systemctl Start sshd # #开启指定服务
Systemctl Restart sshd # #从新启动服务
Systemctl Enable SSHD # #设定指定服务器开机开启
Systemctl Disable SSHD # #设定指定服务器开机关闭
Systemctl Reload sshd # #使指定服务器从新加载配置
Systemctl list-dependencies sshd # #查看指定服务的依赖关系
Systemctl Mask sshd # #冻结指定服务
Systemctl umask sshd # #启用冻结服务
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/8F/99/wKiom1jmEFiBARHFAAM0YzIdZ_4410.png "title=" Screenshot from 2017-04-05 21-33-54.png "alt=" Wkiom1jmefibarhfaam0yzidz_4410.png "/>
Systemctl Set-default Multi-user.target # #开机不开启图形界面
Systemctl Set-default Graphical.target # #开机启动图形界面
3. Service Status
Systemctl Status Service Name
Loaded # #系统服务已经初始化完成, loaded configuration
Active (running) # #争优一个或多个程序在系统中执行
# #vsftpd is the pattern
Active (exited) # #仅执行一次就正常结束的服务
# #目前没有任何程序在系统中执行
Active (Waiting) # #正在执行当中, but wait until another time to continue processing
Inactive # #服务关闭
Enabled # #服务开机启动
Disabled # #服务开机不自启
Static # #服务开机启动项不可被管理
Failed # #系统配置错误
Meng New Linux Learning Path (vii)