织梦后台搭建网站并调用标签建设,微信营销号,wordpress 菜单 外链,老薛主机卸载wordpressCentOS 7 已经切换到 systemd#xff0c;系统指令也有所变化。之前用于启动、重启、停止各种服务的service 作为向后兼容的指令还能使用#xff0c;但是将来可能会消失。同时#xff0c;chkconfig 也改成了systemctl 了。这里列举了一些常用的对应于 service 和 chkconfig 的… CentOS 7 已经切换到 systemd系统指令也有所变化。之前用于启动、重启、停止各种服务的service 作为向后兼容的指令还能使用但是将来可能会消失。同时chkconfig 也改成了systemctl 了。这里列举了一些常用的对应于 service 和 chkconfig 的新的 systemctl指令。 在目前的 CentOS 7或 RHEL 7系统中依然可以使用 service 指令。例如 [rootlocalhost ~]# service network restart
Restarting network (via systemctl): [ OK ][rootlocalhost ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service[rootlocalhost ~]# service sshd restart
Redirecting to /bin/systemctl restart sshd.service 但是系统会自动重定向该指令到新的指令 /bin/systemctl 来执行并给出提示。 是时候切换到新的指令格式了直接使用 systemctl 吧。这个指令的意思就是 system contrl。下面是一些常用的例子 启动服务 systemctl start httpd 停止服务 systemctl stop httpd 重启服务先停止后启动 systemctl restart httpd 重新加载使用新的配置文件 systemctl reload httpd 显示服务状态 systemctl status httpd 与此同时之前用于设定系统启动时自动运行某服务的指令 chkconfig 也改了还是用systemctl。 chkconfig service on 改成了 systemctl enable httpd chkconfig service off 改成了 systemctl disable httpd 检查服务状态的 chkconfig service 改成了 systemctl is-enabled httpd 列举出所有服务的指令 chkconfig –list 改成了 systemctl list-unit-files --typeservice 以前能指定服务 runlevel 的 –levels 也没有了。慢慢适应吧。© 本文发表于水景一页。永久链接https://cnzhx.net/blog/centos-7-rhel-7-systemd-commands/。转载请保留此信息及相应链接。