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

dnsdist loses remote logger thread on daemonizing (-d) #6329

Closed
jpmens opened this Issue Mar 9, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@jpmens
Contributor

jpmens commented Mar 9, 2018

  • Program: dnsdist
  • Issue type: Bug report

Short description

When starting dnsdist with -d (--daemonize), the program doesn't log to a remote logger. It's as though this action were never specified, though the connect is seen:

addAction(AllRule(), RemoteLogAction(newRemoteLogger("10.0.0.1:4242", 2, 2)))

In a private conversation with @rgacogne it turns out that:

we call daemonize() after creating the remote logger thread
daemonize() calls fork() and the parent process exits
so there is no remote logger worker thread anymore

For the record, Remi also says

same pain for TeeAction and, obviously, dnstap

Environment

  • Operating system: SLES12SP3
  • Software version: 1.2.1
  • Software source: OBS package

Expected behaviour

Logging should occur as without daemonize

@rgacogne rgacogne added this to the dnsdist-1.2.x milestone Mar 9, 2018

@jpmens

This comment has been minimized.

Contributor

jpmens commented Mar 16, 2018

It has been brought to my attention that using --daemonize can almost be considered stupid because systemd et.al. exist, so why would I do this? I did this because systemd (though available on the platform I'm working on) isn't used here for launching "applications" such as dnsdist. Having found dnsdist has an option to daemonize I thought I'd use it. That might have been a mistake.

After a bit of consideration, I think the option/code for --daemonize should be removed and be done with it.

@Habbie

This comment has been minimized.

Member

Habbie commented Mar 26, 2018

After a bit of consideration, I think the option/code for --daemonize should be removed and be done with it.

Yes.

@rgacogne rgacogne referenced this issue Mar 26, 2018

Merged

dnsdist: Remove the --daemon option #6394

3 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment