systemctlおよびサービスは、chkconfigのコモンは、比較コマンド

序文

  • それは一つに融合し、chkconfigのサービス機能される前に、systemctlサービス管理システムは、RHEL命令7で、サービスと交換さchkconfigコマンドとコマンドのコレクションです。あなたは永久にそれを使用するか、現在のセッションのみで有効/無効のサービスを有効にすることができます
  • CentOSのは、CentOSのは7もsystemctlを使用して、RHEL(RedHatのエンタープライズLinux)のLinuxディストリビューションの一つに基づいており、サービスとchkconfigの交換を行うときは、CentOSの中にコマンドの後に2つのsystemctlコマンドと同等のものを使用するようにリダイレクトされます7
  • 例sshd.serviceとして機能するために、

systemctl一般的に使用されるコマンド

列出所有服务:systemctl list-unit-files --type=service
列出服务层级和依赖关系:systemctl list-dependencies sshd.service

显示服务状态:systemctl status sshd.service
启动服务:systemctl start sshd.service
关闭服务:systemctl stop sshd.service
重启服务:systemctl restart sshd.service

设置服务开机自启动:systemctl enable sshd.service
禁止服务开机自启动:systemctl disable sshd.service

查看服务是否自启动:systemctl is-enabled sshd.service
列出系统所有服务的启动情况:systemctl list-units --type=service
列出所有自启动服务:systemctl list-unit-files|grep enabled

サービス、chkconfigをよく使用するコマンド

显示服务状态:service sshd status
启动服务:service sshd start
关闭服务:service sshd stop
重启服务:service sshd restart

设置服务自启动:chkconfig --level 3 sshd on
禁止服务自启动:chkconfig --level 3 sshd off

查看服务是否自启动:chkconfig --list sshd
列出系统所有服务的启动情况:chkconfig --list

参考文献:

コマンド管理サービスsystemctl使用して- Linuxの
、chkconfigコマンドをsystemctlコマンド及びサービスの下でLinuxの違いを


エンド〜

公開された15元の記事 ウォンの賞賛5 ビュー10000 +

おすすめ

転載: blog.csdn.net/TomAndersen/article/details/104237056