Skip to content

dnsmasq: stability improvements + greater debuggability - #5015

Merged
vito merged 5 commits into
dagger:mainfrom
vito:dnsmasq-debug
Apr 25, 2023
Merged

vito merged 5 commits into
dagger:mainfrom
vito:dnsmasq-debug

Conversation

@vito

@vito vito commented Apr 24, 2023 •

Copy link
Copy Markdown
Contributor

This fixes a couple of issues:

  • Occasional connection refused errors, caused by configuring bind-dynamic
  • Buggy atomic write implementation leading to missing/empty/partially-written addnhosts file
  • Fixed up the setup sequence to avoid noisy red-herring error logs

It also changes dnsmasq to just run in the foreground and send its logs to the engine logs, rather than daemonizing.

vito added 5 commits April 25, 2023 13:52
...so that it still writes to the pidfile

Signed-off-by: Alex Suraci <[email protected]>
this wasn't really atomic before: it would _rename_ the live file, and
then start writing to it. if dnsmasq itself tried to read the host file,
it could either see that the file doesn't exist, or see a partially
written file.

now we'll write to a new path and then rename it over the live one,
which is atomic.

Signed-off-by: Alex Suraci <[email protected]>
* create addnhosts file if not exists
* set up upstream resolv.conf before starting dnsmasq

Signed-off-by: Alex Suraci <[email protected]>
no idea why this was needed; it dates back to dnsname's initial commit.
it seems to be causing dnsmasq to periodically stop listening and start
listening again:

  #15 73.50 dnsmasq-debug[49]: stopped listening on dagger-dev0(#3): 10.88.0.1 port 53
  #15 73.50 dnsmasq-debug[49]: listening on dagger-dev0(#3): 10.88.0.1 port 53

Signed-off-by: Alex Suraci <[email protected]>
@vito vito changed the title run dnsmasq in engine foreground, with debug logs dnsmasq: stability improvements + greater debuggability Apr 25, 2023
@vito
vito requested review from jlongtine and sipsma April 25, 2023 18:04

@jlongtine jlongtine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@vito
vito merged commit 4603662 into dagger:main Apr 25, 2023
@vito
vito deleted the dnsmasq-debug branch April 25, 2023 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants