Help us understand the problem. What is going on with this article?

Failed to get D-Bus connection: Operation not permitted

More than 1 year has passed since last update.

背景

さて、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

fulcrum
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした