0

If my container running (ENTRYPOINT aka PID 1) - /lib/systemd/systemd systemd.unit=multi-user.service, and also I have VOLUME ["/sys/fs/cgroup"] then why docker exec -it --privileged systemctl --user will display me Failed to connect to bus: No such file or directory.

Is it possible to overcome that somehow?

AnthonyGP
  • 47
  • 2
  • Do you have dbus? – Anya Shenanigans Aug 18 '23 at 19:00
  • @AnyaShenanigans [dbus is pulled and installed as a dependency of systemd and user session bus is started automatically for each user](https://wiki.archlinux.org/title/D-Bus) – AnthonyGP Aug 19 '23 at 05:56
  • @AnthonyGP: That might be true for a full Arch Linux installation where users go through the standard login process, but is it also true for your hand-crafted Docker container where the processes are just spawned directly? Have you **verified** that a user session bus is started for the user that's calling 'systemctl --user'? – user1686 Aug 20 '23 at 10:38
  • 1
    This *seriously* doesn't have enough information to debug. There is no `multi-user.service` on stock linux (it's a target). docker exec *does not* properly start a new session. And this isn't a programming problem to be solved; it's more of a superuser problem – Anya Shenanigans Aug 20 '23 at 19:19
  • @AnyaShenanigans @user1686 when I run `docker run -it --privileged systemctl--user` then everything works fine and I got an output. So, still pending question, how I could execute that `systemctl` on running Docker container with systemd being an entrypoint? – AnthonyGP Aug 21 '23 at 08:32

0 Answers0