本文作者:阿豪

Linux之systemd管理服务

阿豪 6个月前 ( 01-21 ) 6

列出所有系统服务:systemctl list-units --all --type=service

[root@localhost ~]# systemctl list-units --all --type=service

image.png

LOAD   = Reflects whether the unit definition was properly loaded.

ACTIVE = The high-level unit activation state, i.e. generalization of SUB.

SUB    = The low-level unit activation state, values depend on unit type.

那么这些服务对应的启动脚本文件在哪里呢“? ll /usr/lib/systemd/system

[root@localhost ~]# ls /usr/lib/systemd/system

image.png

几个常用的服务相关的命令

systemctl enable crond.service //让服务开机启动

systemctl disable crond //不让开机启动

systemctl status crond //查看状态

systemctl stop crond //停止服务

systemctl start crond //启动服务

systemctl restart crond //重启服务

systemctl is-enabled crond //检查服务是否开机启动

文章版权及转载声明

作者:阿豪本文地址:https://www.ahaoyw.com/article/48.html发布于 6个月前 ( 01-21 )
文章转载或复制请以超链接形式并注明出处阿豪运维笔记

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

分享