-
-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add localhost to /etc/hosts if not already present #779
Comments
sounds good, the install script already adds entries to |
For reference, here is
Also
|
If this still needs to be resolved, I could probably knock it out pretty quick. Should be the kind of grunt work I can currently handle while I'm learning the rest. Should just need the update and install scripts edited, unless I'm mistaken. |
I'll add this in while I'm reworking the scripts. Planned to rework the host entries anyway. |
@wh1te909 this has been added in the rework of the bash scripts I've been working on. Silver and Dinger are going to help test it all. |
Is your feature request related to a problem? Please describe.
I ran into an edge case where celery was taking significantly longer than normal due to
localhost
not resolving locally.Describe the solution you'd like
I'd like for Tactical to be fast at all times and resolve
localhost
without making a network request.Describe alternatives you've considered
This if more of a discussion about a strange edge case and possible documentation in case others run into the same problem. I've considered not opening this request and making note of it for future reference but that doesn't help the community.
Additional context
I installed Ubuntu 20.04 in an nspawn container with
debootstrap
and then installed Tactical using the standard install. One asset was added. Everything was working as expected. Then I introduced Nebula and in the process changed the DNS to use a server in the cloud. This caused significant delays in the frontend but technically everything still worked.The troubleshooting process led to a celery being slow and timing celery shows about a 5 second delay. Compare the production timing with the dev timing.
Production
Dev
The output of
time /rmm/api/env/bin/celery -A tacticalrmm report
showedredis://localhost/
was used which clued me intolocalhost
. This lead to the question: Where islocalhost
resolved? A fresh Ubuntu install creates/etc/hosts
and adds the various localhost flavors for name resolution.Fresh install of Ubuntu 20.04 in VM
Comparing a fresh Ubuntu 20.04 install with an
nspawn
install,/etc/hosts
is missing from the nspawn install and present in the full install./etc/nsswitch.conf
is the same for host resolution:hosts: files dns
. This leads us to DNS. Both systems have/etc/resolv.conf
symlinked to/run/systemd/resolve/stub-resolv.conf
which is provided bysystemd-resolved.service
. The change I made that broke celery was changing the symlink to/run/systemd/resolve/resolv.conf
and adding aDNS=1.1.1.1
entry to/etc/systemd/resolved.conf
, effectively removingsystemd-resolved
from the equation.The
systemd-resolved
documentation states "systemd-resolved' will resolve synthetic records, one of which islocalhost
. Iflocalhost
is not in/etc/hosts
and the DNS has not been changed,localhost
will still resolve locally without making any DNS requests over the network. However, iflocalhost
is not in/etc/hosts
and the DNS has been changed, there will be significant delays in the frontend of Tactical.Adding
localhost
to/etc/hosts
if it's not already present doesn't introduce any problems because the installer adds them. I suggest checking forlocalhost
and if it's not already present, add it to/etc/hosts
.The text was updated successfully, but these errors were encountered: