[CentOS] dbus issue on centos 7 as a lxc container

Wed Oct 7 20:26:21 UTC 2020
Sergio Belkin <sebelk at gmail.com>

Hi,
dbus on centos 7 lxc won't work.

So I'm unable to start  or query status units with systemd, for example:

systemctl status
Failed to get D-Bus connection: No such file or directory


I have no issues with centos 8 container (debian 10 ones work fine too)
This is the output of ps aux on centos 7:

USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.0  0.0  42712  3860 ?        Ss   20:11   0:00
/lib/systemd/systemd systemd.unified_cgroup_hierarchy=1
root           2  0.0  0.0  11840  3052 ?        Ss   20:12   0:00 /bin/bash
root          28  0.0  0.0  51772  3548 ?        R+   20:19   0:00 ps aux

On Centos 8 instead:

USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.0  0.0 241980  5320 ?        Ss   Oct06   0:01
/lib/systemd/systemd systemd.unified_cgroup_hierarchy=1
root          17  0.0  0.0  93944  5552 ?        Ss   Oct06   0:00
/usr/lib/systemd/systemd-journald
root          22  0.0  0.0  97164  2892 ?        Ss   Oct06   0:00
/usr/lib/systemd/systemd-udevd
root          34  0.0  0.0  85920  5252 ?        Ss   Oct06   0:00
/usr/lib/systemd/systemd-logind
dbus          35  0.0  0.0  54108  2312 ?        Ss   Oct06   0:00
/usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile
--systemd-activat
ion --syslog-only
root          37  0.0  0.0 368376  7076 ?        Ssl  Oct06   0:03
/usr/sbin/NetworkManager --no-daemon
root          42  0.0  0.0  78536  4124 ?        Ss   Oct06   0:00
/usr/sbin/sshd -D
-oCiphers=aes256-gcm at openssh.com,chacha20-poly1305 at openssh.com,aes256
-ctr,aes256-cbc,aes128-gcm at openssh.com,aes128-ctr,aes128-cbc
-oMACs=hmac-sha2-256-etm at openssh.com,hmac-sha1-etm at openssh.com,umac-128-etm at openssh.com,hmac-
sha2-512-etm at openssh.com,hmac-sha2-256,hmac-sha1,umac-128 at openssh.com,hmac-sha2-512
-oGSSAPIKexAlgorithms=gss-gex-sha1-,gss-group14-sha1- -oKexAlgorithms=
curve25519-sha256,curve25519-sha256 at libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellma
n-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
-oHostKeyAlgor
ithms=rsa-sha2-256,rsa-sha2-256-cert-v01 at openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp256-cert-v01 at openssh.com,ecdsa-sha2-nistp384,ecdsa-sha2-nistp384-
cert-v01 at openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01 at openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp521-cert-v01 at openssh.com,ssh-ed25519,ssh-ed25519-c
ert-v01 at openssh.com,ssh-rsa,ssh-rsa-cert-v01 at openssh.com
-oPubkeyAcceptedKeyTypes=rsa-sha2-256,rsa-sha2-256-cert-v01 at openssh.com,ecdsa-sha2-nistp256,ecdsa
-sha2-nistp256-cert-v01 at openssh.com,ecdsa-sha2-nistp384,ecdsa-sha2-nistp384-cert-v01 at openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01 at openssh.com,ecdsa-sha2
-nistp521,ecdsa-sha2-nistp521-cert-v01 at openssh.com,ssh-ed25519,ssh-ed25519-cert-v01 at openssh.com,ssh-rsa,ssh-rsa-cert-v01 at openssh.com
-oCASignatureAlgorith
ms=rsa-sha2-256,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,rsa-sha2-512,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa
root          45  0.0  0.0   6520   660 pts/3    Ss+  Oct06   0:00
/sbin/agetty -o -p -- \u --noclear --keep-baud pts/3 115200,38400,9600
vt220
root          46  0.0  0.0   6520   724 pts/2    Ss+  Oct06   0:00
/sbin/agetty -o -p -- \u --noclear --keep-baud pts/2 115200,38400,9600
vt220
root          47  0.0  0.0  22868  1848 ?        Ss   Oct06   0:00
/usr/sbin/crond -n
root          48  0.0  0.0   6520   664 console  Ss+  Oct06   0:00
/sbin/agetty -o -p -- \u --noclear --keep-baud console
115200,38400,9600 linux
root          50  0.0  0.0   6520   728 pts/1    Ss+  Oct06   0:00
/sbin/agetty -o -p -- \u --noclear --keep-baud pts/1 115200,38400,9600
vt220
root          61  0.0  0.0 283500  2176 ?        Ssl  Oct06   0:07
/usr/sbin/rsyslogd -n
root         442  0.0  0.0   6520  1640 pts/0    Ss+  19:47   0:00
/sbin/agetty -o -p -- \u --noclear --keep-baud pts/0 115200,38400,9600
vt220
root         461  0.0  0.0  12020  3340 ?        Ss   20:12   0:00 /bin/bash
root         480  0.0  0.0  44600  3368 ?        R+   20:22   0:00 ps auxwww

Is there a Centos Bug? Or I missing something?
The host is Fedora 32, if you need more information, ask me for.
Thanks in advance!
-- 
--
Sergio Belkin
LPIC-2 Certified - http://www.lpi.org