linux之systemctl命令

入门小站 -
linux之systemctl命令
Linux 服务管理两种方式service和systemctl,systemd是Linux系统最新的初始化系统(init),作用是提高系统的启动速度,尽可能启动较少的进程,尽可能更多进程并发启动。systemd对应的进程管理命令是systemctlchkconfig和systemctl命令对比任务旧指令新指令使某服务自动启动chkconfig --level 3 httpd onsystemctl enable httpd.service使某服务不自动启动chkconfig --level 3 httpd offsystemctl disable httpd.service检查服务状态service httpd statussystemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active)显示所有已启动的服务chkconfig --listsystemctl list-units --type=service启动服务service httpd startsystemctl start httpd.service停止服务service httpd stopsystemctl stop httpd.service重启服务service httpd restartsystemctl restart httpd.service重载服务service httpd reloadsystemctl reload httpd.service实例
#停止cup电源管理服务
> systemctl stop cups.service
#禁止cups服务开机启动
> systemctl disable cups.service
#查看cups服务状态
> systemctl status cups.service
#重新设置cups服务开机启动
> systemctl enable cups.service
常用的系统命令systemctl命令说明systemctl列出所有的系统服务systemctl list-units列出所有启动unitsystemctl list-unit-files列出所有启动文件systemctl list-units –type=service –all列出所有service类型的unitsystemctl list-units –type=service –all grep cpu列出 cpu电源管理机制的服务systemctl list-units –type=target –all列出所有targetsystemctl list-unit-files --type=socket列出所有可用系统套接口systemctl特殊的用法systemctl命令说明systemctl is-active [unit type]查看服务是否运行systemctl is-enable [unit type]查看服务是否设置为开机启动systemctl mask [unit type]注销指定服务systemctl unmask [unit type]取消注销指定服务

原文链接:https://rumenz.com/rumenbiji/...
微信公众号:入门小站

特别申明:本文内容来源网络,版权归原作者所有,如有侵权请立即与我们联系(cy198701067573@163.com),我们将及时处理。

Tags 标签

linuxsystemctl

扩展阅读

加个好友,技术交流

1628738909466805.jpg