2.16. TuneD D-Bus インターフェイスの使用
TuneD D-Bus インターフェイスを介してランタイム時に TuneD と直接通信し、さまざまな TuneD サービスを制御できます。
D-Bus API にアクセスするには、busctl
または dbus-send
コマンドを使用できます。
busctl
コマンドまたは dbus-send
コマンドを使用できますが、busctl
コマンドは systemd
の一部であるため、ほとんどのホストにすでに存在しています。
2.16.1. TuneD D-Bus インターフェイスを使用した利用可能な TuneD D-Bus API メソッドの表示
TuneD D-Bus インターフェイスを使用すると、TuneD で使用できる D-Bus API メソッドを確認できます。
前提条件
- TuneD サービスが実行されている。詳細は、TuneD のインストールと有効化 を参照してください。
手順
利用可能な TuneD API メソッドを確認するには、次のコマンドを実行します。
$ busctl introspect com.redhat.tuned /Tuned com.redhat.tuned.control
この出力は、以下のようになります。
NAME TYPE SIGNATURE RESULT/VALUE FLAGS .active_profile method - s - .auto_profile method - (bs) - .disable method - b - .get_all_plugins method - a{sa{ss}} - .get_plugin_documentation method s s - .get_plugin_hints method s a{ss} - .instance_acquire_devices method ss (bs) - .is_running method - b - .log_capture_finish method s s - .log_capture_start method ii s - .post_loaded_profile method - s - .profile_info method s (bsss) - .profile_mode method - (ss) - .profiles method - as - .profiles2 method - a(ss) - .recommend_profile method - s - .register_socket_signal_path method s b - .reload method - b - .start method - b - .stop method - b - .switch_profile method s (bs) - .verify_profile method - b - .verify_profile_ignore_missing method - b - .profile_changed signal sbs - -
利用可能なさまざまなメソッドの説明は、TuneD のアップストリームリポジトリー に記載されています。
2.16.2. TuneD D-Bus インターフェイスを使用したアクティブな TuneD プロファイルの変更
TuneD D-Bus インターフェイスを使用して、アクティブな TuneD プロファイルを必要な TuneD プロファイルに置き換えることができます。
前提条件
- TuneD サービスが実行されている。詳細は、TuneD のインストールと有効化 を参照してください。
手順
アクティブな TuneD プロファイルを変更するには、次のコマンドを実行します。
$ busctl call com.redhat.tuned /Tuned com.redhat.tuned.control switch_profile s profile (bs) true "OK"
profile は、必要なプロファイルの名前に置き換えます。
検証
現在アクティブな TuneD プロファイルを表示するには、次のコマンドを実行します。
$ busctl call com.redhat.tuned /Tuned com.redhat.tuned.control active_profile s "profile"