Translated message

A translation of this page exists in English.

別のユーザーとして "systemctl --user" を実行する方法

Solution Verified - Updated -

Issue

  • 別のユーザーとして systemctl --user を実行しようとすると、Failed to connect to bus: No such file or directory で失敗します。

    # systemctl --user list-units
    Failed to connect to bus: No such file or directory
    
  • ターゲットユーザーの環境変数 XDG_RUNTIME_DIR を設定した後に systemctl --user を実行しようとすると、Failed to connect to bus: Operation not permitted が表示されて失敗します。

    # id -u user1
    1000
    # export XDG_RUNTIME_DIR=/run/user/1000
    # systemctl --user list-units
    Failed to connect to bus: Operation not permitted
    

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
    • systemd (ユーザーインスタンス)
    • sudo/su

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content