8. 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://s1.51cto.com/wyfs02/M02/8F/A4/wKioL1jnWwrgxzG8AAIHdhyxVEk569.jpg "title=" 36020170407172503192.jpg "alt=" Wkiol1jnwwrgxzg8aaihdhyxvek569.jpg "/>
Systemctl list-unit-files # #列出服务的开机状态
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/8F/A6/wKiom1jnWxnz1BrnAADlxMnEdBg958.jpg "title=" 36020170407172515647.jpg "alt=" Wkiom1jnwxnz1brnaadlxmnedbg958.jpg "/>
systemctl Status sshd # #查看指定服务的状态
systemctl Stop sshd # #关闭指定服务
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/8F/A4/wKioL1jnW7jy4XgpAAD3neAlhW4279.jpg "title=" 36020170407172701408.jpg "alt=" Wkiol1jnw7jy4xgpaad3nealhw4279.jpg "/>
systemctl start sshd # #开启指定服务
systemctl Restart sshd # #从新启动服务
Systemctl Enable sshd # #设定指定服务开机开启
systemctl Disable sshd # #设定指定服务开机关闭
Systemctl Reload sshd # #使指定服务从新加载配置
systemctl list-dependencies sshd # #查看指定服务的倚赖关系
Systemctl Mask sshd # #冻结指定服务
systemctl unmask sshd # #启用服务
systemctl Set-default multi-user.target # #开机不开启图形
systemctl Set-default graphical.target # #开机启动图形
Setterm # #文本界面设定color
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M01/8F/A6/wKiom1jnW9-Su7tLAAF9eu2DrP0665.jpg "style=" float : none; "title=" 36020170407172712008.jpg "alt=" Wkiom1jnw9-su7tlaaf9eu2drp0665.jpg "/>
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M01/8F/A5/wKioL1jnW-CzA-NIAACPeB3tI5s185.jpg "style=" float : none; "title=" 36020170407172744272.jpg "alt=" Wkiol1jnw-cza-niaacpeb3ti5s185.jpg "/>
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M01/8F/A6/wKiom1jnXDGDuOgYAACJDY8Efv0043.jpg "style=" float : none; "title=" 36020170407172930712.jpg "alt=" Wkiom1jnxdgduogyaacjdy8efv0043.jpg "/>
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M02/8F/A6/wKiom1jnXDGC7GsZAAB_G_PKRCM164.jpg "style=" float : none; "title=" 36020170407172955504.jpg "alt=" Wkiom1jnxdgc7gszaab_g_pkrcm164.jpg "/>
3. Service Status
Systemctl Status Service Name
Loaded # #系统服务已经初始化完成, loaded configuration
Active (running) # #正有一个或多个程序正在系统中执行,
# VSFTPD is this pattern
atcive (exited) # #僅執行一次就正常結束的服務,
# There are no programs in the system at this time.
atcive (Waiting) # #正在執行當中,
# and wait for other events to continue
Inactive # #服务关闭
enbaled # #服务开机启动
Disabled # #服务开机不自启
Static # #服务开机启动项不可被管理
failed # #系统配置错误
Linux Learning Unit 8