Feature request: foreground mode

Hello unbound developers,

I like to run daemons using the supervise tool from the daemontools package. This needs the daemon to run in the foreground (ie. not detach from the controlling terminal). Could you please add this feature to unbound (with a -f command-line option to enable it, for example).

I can see that the code already has the facility to run unbound in the foreground, if the configuration parameter "do_daemonize" is set to zero, but there's no code to actually read this variable from the config file or from a command-line switch. If you could enable this for the next release of unbound (or provide a diff against 0.9) I'd be grateful.

Regards,

Anand Buddhdev
DNS Services Manager
RIPE NCC

Hi Anand,

With the -d option, unbound does not detach from the terminal.
You can quit it with ^C for example.

- -d is called 'debug_mode' in the source at that point, which could be
why you missed it. The option has no other effects.

Is this the functionality you are looking for?

Best regards,
~ Wouter

Anand Buddhdev wrote:

Hi!

Now there is also
  do-daemonize: <yes or no>
for in the config file.

Best regards,
~ Wouter

W.C.A. Wijngaards wrote:

Hi Wouter,

With the -d option, unbound does not detach from the terminal.
You can quit it with ^C for example.

-d is called 'debug_mode' in the source at that point, which could be
why you missed it. The option has no other effects.

Is this the functionality you are looking for?

Yes, this is indeed the functionality that I'm looking for. I do see now
that the debug mode isn't doing anything else. However, there may be a use
for it in the future, so I still prefer an option to only keeps the daemon
in the foreground, without invoking the debug mode.

I've seen your other message, where you mentioned that the code now reads
and acts upon "do-daemonize" in the config file. That is sufficient for
me.

Regards,

Anand Buddhdev
DNS Services Manager
RIPE NCC