On to, 19 marras 2020, Nikos Mavrogiannopoulos wrote:
On Wed, Nov 18, 2020 at 2:23 PM Alexander Bokovoy
<abokovoy(a)redhat.com> wrote:
>
> On ke, 18 marras 2020, Nikos Mavrogiannopoulos wrote:
> >Hi,
> > I realized my fedora-based containers have an /etc/resolv.conf which
> >claims it is managed by resolved, and nsswitch.conf has "resolve" in
> >hosts. However, doing something like
> ># systemd-resolve --status
> >
> >results to:
> >sd_bus_open_system: No such file or directory
> >
> >Trying to start dbus claims that systemd is not the init:
> ># systemctl start dbus
> >System has not been booted with systemd as init system (PID 1). Can't
operate.
> >Failed to connect to bus: Host is down
> >
> >
> >Is there a way to use systemd resolved in a container?
>
> I figured this out yesterday -- at least in Rawhide, dbus-daemon is now
> replaced by dbus-broker which is not active by default.
>
> So you need
>
> systemctl enable --now dbus-broker
>
> Without it even hostnamectl doesn't work, not just systemd-resolve.
Is that on the "default" fedora container, or do you use something
else? On fedora33 I get the same message about dbus and systemd not
being pid 1.
We build our own Fedora container with systemd based on the 'default' one.
I haven't tried 'fedora-init' variant as Dan suggested.
--
/ Alexander Bokovoy
Sr. Principal Software Engineer
Security / Identity Management Engineering
Red Hat Limited, Finland