LoginSignup
7
5

More than 5 years have passed since last update.

Failed to get D-Bus connection: Operation not permitted

Posted at

背景

さて、Dockerでお約束のhttpd起動してるかなぁと思って、下記投入。
# systemctl status httpd

すると、冷たく
Failed to get D-Bus connection: Operation not permitted
なんでやねん。

注意書き

まじめな方は、下記ご参照下さい。
https://qiita.com/muddydixon/items/d2982ab0846002bf3ea8
https://qiita.com/yunano/items/9637ee21a71eba197345

解決法。

ただし、セキュリティ上疑念は残る。

①コンテナー作成

# docker run --privileged -d --name cs04 centos /sbin/init

「--privileged」は特権モード、「/sbin/init」って…見なかった事にしよう。

「-d」コンテナを起動するだけでアタッチはしない(コンテナには入らない)
これも重要ですね。/sbin/initでは入れないもん。ちなみに「-it」の逆ってことか。

②コンテナー起動

いらないかも。
# docker start cs04

③シェル起動&ログイン

# docker exec -it cs04 /bin/bash

7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5