Solved Unbound - which directory?

Greetings all,

there appear to be several directories for dns/unbound, one is /etc/unbound and the second one is /var/unbound. Both of them are created with directory conf.d. Upon installation of dns/unbound from ports, additional directory /usr/local/etc/unbound is created since it is for third parties programs, albeit without the conf.d.

I had not initially realized that and created all the necessary files, i.e., root.key, root.hints, and unbound.conf in the /etc/unbound directory, and all worked. Today, after realizing that I am really running the one from ports, I have moved the files to /usr/local/etc/unbound, but the dns/unbound now refuses to start with report: "unbound fatal error: could not open ports /etc/rc.conf WARNING could not start unbound". Furthermore:
Code:
service unbound start
env: /usr/local/etc/rc.d/unbound: Permission denied

Since simply moving the files between the /etc/unbound and /usr/local/etc/unbound causes a problem, it seems to indicate that there a difference among the directories.

Any help would be appreciated.

Kindest regards,
M
 
The files in /etc/unbound/ are used by unbound in our base system.
In /usr/local/etc/unbound/ these files are used by unbound found in our ports tree.
The unbound files found in /var/unbound are log files and temp files.

What is probably happening is that you are trying to load unbound twice. One from base and once from ports.
So you need to put the correct settings in /etc/rc.conf to load unbound from ports.
There should be details in /usr/local/etc/rc.d/unbound for the trigger for /etc/rc.conf
It should be a different command than the one to load unbound from base.
 
After further review by building our ports tree version of unbound I noticed this:
FreeBSD base unbound does not use an /etc/rc.d/unbound startup service.

Whereas ports tree unbound uses an /usr/local/etc/rc.d/unbound
This is started from /etc/rc.conf with the following trigger:
unbound_enable="YES"
To use the ports version you should also remove /etc/unbound.conf and use /usr/local/etc/unbound.conf.
Please note that /etc/unbound/ directory is actually a symbolic link to /var/unbound/
 
Hi Phishfry,

as much as I appreciate your answer - especially, since I now understand the purpose of all the different unbound related directories - I believe that you overlooked that I had written that all the time I was using the port version, and the only change I made, after I realized that I created the files, i.e., root.key, root.hints, and unbound.conf in the /etc/unbound directory, was to move the files to the correct /usr/local/etc/unbound directory. Consequently, since I had unbound_enable="YES" in /etc/rc.conf, I was starting the port version of unbound.

What turned out to be the problem was inability to create sockets, the system complained about lack of space in so-rcvbuf and so-sndbuf.

I do not understand how this could happen, especially since I had bee restarting the computer, nevertheless, the problem has been solved.

Kindest regards,

M
 
Most people have had success with unbound, not local-unbound particularly when it comes to control set-up.
 
Hi Alain,

per Phishfry's explanation confirmed by MarcoB, the local unboud uses /etc/unbound symlinked to /var/unbound. But I had always used the unbound from ports.

Kindest regards,

M
 
Back
Top