Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to solve Docker issue Failed to connect to bus: No such file or directory

Tags:

linux

docker

Trying to run following command in the ubuntu 16.04 docker container

root@mytest:/Linux_Insight_Agent# systemctl start ir_agent.service

I have installed neede packages but at the time of starting the service following issue is coming.

Failed to connect to bus: No such file or directory
like image 979
Ashwani Avatar asked Mar 14 '18 18:03

Ashwani


2 Answers

That's because "systemctl" talks to the systemd daemon by using the d-bus. In a container there is no systemd-daemon. Asking for a start will probably not quite do what you expect - the dev-mapping need to be a bit longer.

Another solution may be to avoid the usage of a systemd daemon with the help of the docker-systemctl-replacement script. It overwrites default systemctl however.

like image 136
Guido U. Draheim Avatar answered Oct 22 '22 02:10

Guido U. Draheim


I had the same situation In my case, i resolve by running docker with --volume parameter.

example:

docker run -it \
    --volume /sys/fs/cgroup:/sys/fs/cgroup:ro \
    --rm IMAGE /bin/bash

I hope works for you...

like image 30
Ruan Arcega Avatar answered Oct 22 '22 03:10

Ruan Arcega