Linuxサーバ、サービス管理--systemctl詳細なコマンドは、スタートからの起動を設定します
syetemcltは、サービスの統合であり、これらの2つのコマンドをchkconfigを、CentOSの7が使用されるようになりました。
要約:systemctlサービスマネージャは、それが実際にサービスの組み合わせで、一緒にこれらの2つのコマンドをchkconfigを、システムコマンドです。
タスク | 旧指示 | 新しいディレクティブ |
自動的に起動するサービスを作成します | chkconfigを--level 3 httpdの上 | httpd.serviceを有効systemctl |
サービスが自動的に起動しないように、 | chkconfigを--level 3 httpdのオフ | systemctl禁止httpd.service |
サービスの状態を確認してください | サービスのhttpdのステータス | systemctlステータスhttpd.service(サービス詳細)systemctlは、あるアクティブhttpd.service(表示のみアクティブの場合) |
それは、すべてのサービスが開始さを示します | chkconfigを--list | systemctlリスト単位--type =サービス |
サービスを開始 | サービスのhttpd開始 | httpd.serviceを開始systemctl |
サービスを停止します | サービスのhttpd停止 | systemctl停止httpd.service |
サービスを再起動します。 | サービスのhttpdの再起動 | systemctl再起動httpd.service |
NFSサービスの下に、例えば:
1. NFSサービスを開始
systemctl start nfs-server.service
2.スタートからの起動を設定します
systemctl enable nfs-server.service
3.スタートからの起動を停止します
systemctl disable nfs-server.service
4.サービスの現在の状態を確認
systemctl status nfs-server.service
5.サービスを再起動します
systemctl restart nfs-server.service
6.チェックは、すべてのサービスを開始しました
systemctl list -units --type=service
22個のオープンファイアウォールポート
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
問題が解決しない場合、それは、SELinuxが原因である可能性があり
SELinuxを閉じます。
その後、/ etc / selinux / configファイルSELINUX = "" 無効に、再起動とを変更
ファイアウォールを完全にオフにします。
sudo systemctl status firewalld.service sudo systemctl stop firewalld.service sudo systemctl disable firewalld.service