• 通过 systemctl 管理单一服务 (service unit) 的启动/ 开机启动与观察状态

通过 systemctl 管理服务

常见状态

通过 systemctl 管理服务

通过 systemctl 管理服务

daemon默认状态

通过 systemctl 管理服务

       很多服务彼此之间是有相依性的。cups 是一种打印服 务,这个打印服务会启用 port 631 来提供网络打印机的打印功能。 其实我们无须一直启动 631 端口。因此,多了一个名为 cups.socket 的服务,这个服务可以在“用户有需要打印 时,才会主动唤醒 cups.service ”。 因此,如果你仅是 disable/stop cups.service 而忘记了其他两个服务的话,那么当有用户向其他两个 cups.path, cups.socket 提出要求时, cups.service 就会被唤醒。

    • 强迫服务注销 (mask)

通过 systemctl 管理服务

使用unmask注销mask之后还是inactive

通过 systemctl 管理服务

    • 通过 systemctl 观察系统上所有的服务

通过 systemctl 管理服务

通过 systemctl 管理服务

查找单个类别

通过 systemctl 管理服务

    • 通过 systemctl 管理不同的操作环境 (target unit)

 操作界面 比较有关的 target 项目

通过 systemctl 管理服务

target项目需要使用isolate切换,不能使用start,stop。

通过 systemctl 管理服务

 

通过 systemctl 管理服务

通过 systemctl 管理服务

    • 通过 systemctl 分析各服务之间的相依性

通过 systemctl 管理服务

 

通过 systemctl 管理服务

查看socket file

通过 systemctl 管理服务

查看服务与端口的对应cat /etc/services

通过 systemctl 管理服务

 

相关文章: