linux的systemctl命令介绍

以下以sshd服务为例

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

systemctl disable sshd //不让开机启动,可不加.service

systemctl status sshd //查看启停状态

systemctl stop sshd //停止服务

systemctl start sshd //启动服务

systemctl restart sshd //重启服务

systemctl is-enabled sshd //检查服务是否开机自启

如下显示enabled,该服务为开机自启

[root@localhost ~]# systemctl is-enabled sshd 
enabled

其他systemctl的具体介绍参考此贴
linux中systemd服务介绍

猜你喜欢

转载自blog.csdn.net/qq_17576885/article/details/122707534
今日推荐