Open pemensik opened 3 months ago
Why does toolbox change the hostname?
I expect just to make easier identification of toolbox shell, that you are inside the toolbox. But that is just my guess, which might be wrong. Hostname is displayed by shell of any distribution by PS1 variable. But I guess the question might be more for local maintainers, who might not only guess.
There seems to be also issue with X11 forwarding, issue #1343. Which misbehaves because changed hostname.
Describe the bug Toolbox fails to resolve names together with systemd-resolved. Filled systemd issue https://github.com/systemd/systemd/issues/33870, but systemd maintainers think hostname should not be changed. And that it is failure of toolbox to change system identification, but not fully.
Initially reported at bug https://bugzilla.redhat.com/show_bug.cgi?id=2291062
Is the changing of hostname good idea, when variable
$HOSTNAME
stays unmodified? Is there specific reason, why it is implemented the current way? Would not some shell variable work better maybe just overriding PS1 prompt?Steps how to reproduce the behaviour
toolbox enter
.toolbox.lan
, wheretoolbox
is what$(hostname)
command returns.Expected behaviour It should resolve fast and clean. It should not fail to take a long to resolve.
Actual behaviour Under specific conditions, because NSS plugin
resolve
is ordered beforemyhostname
plugin, it may take quite a long time. That is because unlikemyhostname
plugin,systemd-resolved.service
does not understand that toolbox.$SUFFIX is its own hostname. Tries it to find on the network and may fail when doing that.Screenshots None, see https://bugzilla.redhat.com/show_bug.cgi?id=2291062
Output of
toolbox --version
(v0.0.90+) 0.0.99.5Toolbx package info (
rpm -q toolbox
)toolbox-0.0.99.5-11.fc40.x86_64
Output of
podman version
Podman package info (
rpm -q podman
)podman-5.2.1-1.fc40.x86_64
Info about your OS Fedora 40
Additional context
This happens because some black magic is specially applied on $HOSTNAME queries. But because toolbox uses different hostname, it does not recognize it as own name at systemd-resolved and resolves it like any other name. On certainly broken networks that may take exceptionally long time.
This happens on Fedora 40, where just
toolbox enter
is used and systemd-resolved is enabled by default.