Unbound crashes after unbound-control reload

Hi all,

I've found that unbound crashes on OpenBSD after issuing the command: unbound-control reload:

# unbound-control reload
ok
ps agx |grep unbound

1367 p1 R+ 0:00.00 grep unbound (ksh)
# unbound-control start
[1229954623] unbound[26014:0] warning: increased limit(open files) from 128 to 312
[1229954623] unbound[26014:0] warning: did not exit gracefully last time (9217)

I'm using the latest patch release:
# unbound-control status
version: 20081218
verbosity: 1
threads: 1
modules: 2 [ validator iterator ]
uptime: 207 seconds
unbound (pid 6454) is running...

Can you help me out?

Regards,
Marc Groeneweg

Hi Marc,

Wouter enjoys his christmas holidays at the moment, so let me answer
your e-mail.

It seems to work fine on Linux. Could you increase the verbosity level
to 4 (debug logs), or provide actual debugger output (for example, gdb
- --args unbound -d -vvvv; then 'run' and 'bt'), so we can see what is
actual going wrong?

Kind regards,

Matthijs Mekking
NLnet Labs

Marc Groeneweg wrote:

Hi Matthijs,

Wouter enjoys his christmas holidays at the moment, so let me answer
your e-mail.

And a deserved one i guess :slight_smile:

It seems to work fine on Linux. Could you increase the verbosity level
to 4 (debug logs), or provide actual debugger output (for example, gdb
--args unbound -d -vvvv; then 'run' and 'bt'), so we can see what is
actual going wrong?

I'm running Unbound on OpenBSD 4.4. And I think I know whats happening: it has something to do with the chrooted environment. This is the debug output:

#unbound -d -vvvv >output.log
[1230032843] unbound[22786:0] notice: Start of unbound 20081218.
[1230032843] unbound[22786:0] warning: increased limit(open files) from 128 to 300
[1230032843] unbound[22786:0] debug: creating udp4 socket 127.0.0.1 53
[1230032843] unbound[22786:0] debug: creating tcp4 socket 127.0.0.1 53
[1230032843] unbound[22786:0] debug: creating tcp4 socket 127.0.0.1 953
[1230032843] unbound[22786:0] debug: switching log to syslog

/etc/unbound.conf:32: error: cannot open include file '/sidn/unbound/etc/unbound-sidn-overrides.conf': No such file or directory
read /etc/unbound.conf failed: 1 errors in configuration file

We have absolute paths in the unbound.conf, but the reload command work in the chrooted invironment. How to solve this?

Regards,
Marc

Matthijs,

So, if I understand correctly, unbound can open the include file, but
unbound-control not because the include file is outside the chroot
environment?

Can this be fixed with a symbolic link within the chroot environment

to

the include file?

Yep, this works.
In directory /sidn/unbound:
mkdir -p sidn/unbound/etc
cd sidn/unbound/etc
ln -s ../../../etc/unbound-sidn-overrides.conf
unbound-sidn-overrides.conf

# unbound-control reload
ok

But I find this strange behavior. I should guess, that in the
unbound/conf you should give only the relative paths to the chrooted
directory for includes. But this is only the case with reload, not when
starting Unbound.

Regards,
Marc

Marc,

We have absolute paths in the unbound.conf, but the reload command work in the chrooted invironment. How to solve this?

you could try creating symlink inside chroot as temporary workaround.

Ondrej.

[chroot problems]

But I find this strange behavior. I should guess, that in the
unbound/conf you should give only the relative paths to the chrooted
directory for includes. But this is only the case with reload, not when
starting Unbound.

That's why I've switched unbound in fedora to depend on SElinux, and got
rid of the entire chroot. (Still needs to propagate to EPEL and Fedora
releases)

Paul

That's why I've switched unbound in fedora to depend on SElinux, and got
rid of the entire chroot. (Still needs to propagate to EPEL and Fedora
releases)

Paul, is that just for you, or as an "official" maintainer of the package
for Fedora?

If the latter, then that would prevent me from running Unbound as I don't
have (or want) SELinux on my home machine.

Ray

> That's why I've switched unbound in fedora to depend on SElinux, and got
> rid of the entire chroot. (Still needs to propagate to EPEL and Fedora
> releases)

Paul, is that just for you, or as an "official" maintainer of the package
for Fedora?

It is currently only in rawhide, but the idea is to migrate it to the other
releases as well.

If the latter, then that would prevent me from running Unbound as I don't
have (or want) SELinux on my home machine.

From a distribution point of view, it makes no sense to keep small chroot

copies of the OS itself for various kinds of applications. Named I believe
laready lost its chroot as well.

There were various problems with the chroot. For one, there is the issue of
updated DNSSEC keys (via dnssec-keys and autotrust). Then there is the issue
of package updates and the --bind mounts not getting unmounted in time for
the package to do an update without causing problems in the scriptlets.

And last, with the coming of instant cheap VM's for a single purpose (eg
nameserver) the concept of chroot's is becoming rather useless. The only
value content of a VM running a nameserver is within the chroot itself.

I can see about adding an option for chroot building in the spec file, and
having it disabled per default, so you only need to rpmbuild the source rpm
with a --define 'use-chroot=yes' but I'd still prefer to just completely get
rid of it.

Paul

From a distribution point of view, it makes no sense to keep small

chroot

copies of the OS itself for various kinds of applications. Named I

believe

laready lost its chroot as well.

There were various problems with the chroot. For one, there is the issue

of

updated DNSSEC keys (via dnssec-keys and autotrust). Then there is the

issue

of package updates and the --bind mounts not getting unmounted in time

for

the package to do an update without causing problems in the scriptlets.

And last, with the coming of instant cheap VM's for a single purpose (eg
nameserver) the concept of chroot's is becoming rather useless. The only
value content of a VM running a nameserver is within the chroot itself.

Paul, I don't (much) care about using the chroot.

I do care about being forced to run SELinux.

kind regards,

Ray

It will run fine without SElinux protection. It will just be
configured as "non chroot".

Paul

It will run fine without SElinux protection. It will just be
configured as "non chroot".

OK, that's fine. That's a somewhat weaker requirement than suggested
earlier when you said that you'll make it "depend on SELinux".

kind regards,

Ray

Ondřej Surý wrote:

Marc,

We have absolute paths in the unbound.conf, but the reload command work in the chrooted invironment. How to solve this?

you could try creating symlink inside chroot as temporary workaround.

Ondrej.

Hi Marc,

In the latest svn trunk of unbound, the included files are adjusted for
the chroot (if they are absolute paths), so that reloads work.

Best regards,
   Wouter