Show Table of Contents
10.5. リモートマシン上での systemd の制御
systemd システムおよびサービスマネージャーをローカルで制御することに加え、
systemctl ユーティリティーでは、SSH プロトコルを使ってリモートマシン上で実行している systemd と対話操作することができます。sshd サービスがリモートマシン上で実行中であれば、systemctl コマンドに --host または -H オプションを付けて実行すると、このマシンに接続できます。
systemctl --host user_name@host_name command
user_name をリモートのユーザー名で、host_name をマシンのホスト名で、
command を上記の systemctl コマンドのいずれかでそれぞれ置き換えます。指定されたユーザーが SSH プロトコルを使ってリモートアクセスできるようにリモートマシンを設定する必要があることに注意してください。SSH サーバーの設定に関する詳細情報は、12章OpenSSH を参照してください。
例10.16 リモート管理
server-01.example.com という名前のリモートマシンに root ユーザーとしてログインし、httpd.service ユニットの現在の状態を判断するには、シェルプロンプトに以下を入力します。
~]$ systemctl -H root@server-01.example.com status httpd.service
>>>>>>> systemd unit files -- update
root@server-01.example.com's password:
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: active (running) since Fri 2013-11-01 13:58:56 CET; 2h 48min ago
Main PID: 649
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.