Linux-共通命令05-systemd
2023 ワード
systemd
すなわちsystem deamonは、Linuxの下のinitソフトウェアであり、redhat、ubuntu、centosなど、ほとんどのオープンソースの異なるリリース版のlinuxがサポートしています.システムdは命令のセットであり、その中で最も主要なのはシステムctlコマンドである.
1.systemctlメインコマンド
1.1共通コマンド
Systemctlはsystemの主なコマンドであり、システムとサービスを管理する.
man systemctl systemctlヘルプドキュメントの表示 . を開始 を閉じる. サービスプロファイルの変更
1.2 unitの認知
unitコンセプト:systemdはすべてのシステムリソースを管理できます.異なるリソースを総称してunit単位と呼ぶ unitは全部で12種類に分けられます serviceシステムサービス target複数のunitからなる1つのグループ deviceハードウェアデバイス mountファイルシステムのマウントポイント 自動マウントポイント pathファイルまたはパス scopeはsystemdによって開始された外部プロセス ではない. sliceプロセスグループ snapshotスナップショット socketプロセス間の通信のsocket swap swapファイル timerタイマ unit関連コマンド のリスト をリストする. を見つけませんでした. をリストする. がリストされます.
2.systemd-analyze起動時間の表示
3.ホスト情報の表示と設定 を設定する.
4.localectlローカライズ情報の表示と設定
5.timedatectl現在のタイムゾーンの表示と設定
6.loginctl現在のログインユーザーの表示
すなわちsystem deamonは、Linuxの下のinitソフトウェアであり、redhat、ubuntu、centosなど、ほとんどのオープンソースの異なるリリース版のlinuxがサポートしています.システムdは命令のセットであり、その中で最も主要なのはシステムctlコマンドである.
1.systemctlメインコマンド
1.1共通コマンド
Systemctlはsystemの主なコマンドであり、システムとサービスを管理する.
man systemctl systemctlヘルプドキュメントの表示
systemctl reboot
再起動systemctl poweroff
システムを閉じる、電源を切るsystemctl halt
CPU停止動作systemctl start httpd.service
httpdサービスsystemctl stop httpd.service
閉鎖サービスsystemctl restart httpd.service
サービス再開systemctl kill httpd.service
httpサービス下のすべてのサブプロセスsystemctl enable httpd.service
起動httpd systemctl disable httpd.service
起動禁止httpd systemctl daemon-reload
再ロード構成systemctl restart httpd.service
再起動が有効になる1.2 unitの認知
unitコンセプト:systemdはすべてのシステムリソースを管理できます.異なるリソースを総称してunit単位と呼ぶ
systemctl list-units
実行中のunit systemctl list-units --type=service
は、サービスとして実行中のすべてのサービスsystemctl list-units --all
はすべてのunitをリストし、パッケージはプロファイルまたは起動に失敗したsystemctl list-units --failed
は、すべてのロードに失敗したサービスsystemctl list-units --all --state=inactive
実行されていないunit 2.systemd-analyze起動時間の表示
3.ホスト情報の表示と設定
hostnamectl set-hostname [newhostname]
ホスト名4.localectlローカライズ情報の表示と設定
5.timedatectl現在のタイムゾーンの表示と設定
6.loginctl現在のログインユーザーの表示