网站原创文章优化,wordpress怎么买模板,最近十大新闻,手把手教你用动易做网站CentOS 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 restartRestarting network (via systemctl): [ OK ][rootlocalhost ~]# service httpd restartRedirecting to /bin/systemctl restart httpd.service[rootlocalhost ~]# service sshd restartRedirecting to /bin/systemctl restart sshd.service但是系统会自动重定向该指令到新的指令 /bin/systemctl 来执行并给出提示。是时候切换到新的指令格式了直接使用 systemctl 吧。这个指令的意思就是 system control。下面是一些常用的例子启动服务systemctl start httpd停止服务systemctl stop httpd重启服务(先停止后启动)systemctl restart httpd重新加载(使用新的配置文件)systemctl reload httpd显示服务状态systemctl status httpd与此同时之前用于设定系统启动时自动运行某服务的指令 chkconfig 也改了还是用 systemctl。chkconfig service on改成了systemctl enable httpdchkconfig service off改成了systemctl disable httpd检查服务状态的chkconfig service改成了systemctl is-enabled httpd列举出所有服务的指令chkconfig –list改成了systemctl list-unit-files –typeservice以前能指定服务 runlevel 的 –levels 也没有了。慢慢适应吧。©