systemd-analyze コマンドは、ブート操作のパフォーマンス統計を取得するために使用されます。このコマンドは、どのタイプの情報をどのように出力するかを決定する 1 つ以上のサブコマンドを取ります。プロセス管理とトラブルシューティングでは、blame が最も適切なサブコマンドです。これにより、起動時に実行されたすべての systemd ユニットのリストが、各ユニットの実行にかかった時間とともに出力されます。 systemd-analyze Blame を使用できます システムの起動を遅くするサービスやその他のユニットを特定します。
構文
systemd-analyze コマンドの構文は次のとおりです:
# systemd-analyze [options] [subcommand]
systemd-analyze コマンドの実行中に以下のエラーが発生した場合:
systemd-analyze: command not found
選択したディストリビューションに従って systemd パッケージをインストールしてみてください:
OS 分布 | コマンド |
---|---|
Debian | apt-get install systemd |
Ubuntu | apt-get install systemd |
Arch Linux | pacman -S systemd |
カリ Linux | apt-get install systemd |
CentOS | yum install systemd |
Fedora | dnf install systemd |
Raspbian | apt-get install systemd |
systemd-analyze コマンドの例
1. 各ユニットの起動時間を一覧表示:
# systemd-analyze blame
2. タイム クリティカルなユニット チェーンのツリーを出力します。
# systemd-analyze critical-chain
3. 各システム サービスがいつ開始されたかを示す SVG ファイルを作成し、初期化に費やされた時間を強調表示します。
# systemd-analyze plot > path/to/file.svg
4. 依存関係グラフをプロットし、SVG ファイルに変換します:
# systemd-analyze dot | dot -Tsvg > path/to/file.svg
5. 実行中のユニットのセキュリティ スコアを表示:
# systemd-analyze security