Re: compile and install from source

2015-03-31 Thread @lbutlr

> On Mar 31, 2015, at 02:46, Mathieu Arnold  wrote:
> 
> +--On 30 mars 2015 19:32:09 -0600 "@lbutlr"  wrote:
> |> # /usr/local/sbin/named -u bind -c /etc/namedb/named.conf \
> |>-t /var/named
> | 
> | Yes, that works without reporting any errors, so the issue appears to be
> | with /usr/local/etc/rc.d/named startup script.
> 
> Well, your first post says you're using 8.4, so there should be no such
> script, it should be in /etc/rc.d.

Yes, you’re right. That was a thinko.

>  /usr/local/sbin/rndc status
> | rndc: neither /etc/rndc.conf nor /etc/rndc.key was found
> 
> That's because you built named manually and not from ports, so it doesn't
> know where it should find its bits.

I don’t see why not, /etc/defaults/rc.conf shows:

named_program="/usr/sbin/named" # Path to named, if you want a different one.
named_conf="/etc/namedb/named.conf" # Path to the configuration file
named_chrootdir="/var/named"# Chroot directory (or "" not to auto-chroot it)

So it seems it should be looking in /var/named/etc/namedb/ (and in fact it does 
look there for the conf file); rndc seems to be looking elsewhere though.

> | Now, it is true that there is no rndc.conf, but that is true all all
> | three name servers. There is a rndc.key in /var/named/etc/namedb/rndc.conf
> | 
> | I’m not sure why it is looking in (I assume /var/named/etc instead of)
> | /var/named/etc/namedb.
> 
> Because you built it manually so it did not get all the right configure
> options the port has.

OK, well I cannot build via ports, so what magic does the port invoke?

> | is named_chrootdir="/var/named" not correct?
> 
> It is.

Then why can’t rndc find the key file? And why is it looking outside the chroot?

 # cp rndc.key /etc
 # rndc status
version: 9.9.7 
[… Stuff …]
server is up and running
 #


-- 
Honesty may be the best policy, but it's important to remember that
apparently, by elimination, dishonesty is the second-best policy.

___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: compile and install from source

2015-03-31 Thread Matthew Seaman
On 31/03/2015 02:32, @lbutlr wrote:
>> Can you start the named process "by hand" -- the command line should be
>> > something like:
>> > 
>> > # /usr/local/sbin/named -u bind -c /etc/namedb/named.conf \
>> >-t /var/named

> Yes, that works without reporting any errors, so the issue appears to
> be with /usr/local/etc/rc.d/named startup script.

Since you're running FreeBSD 8.4, you will still have the startup
scripts from the base system -- /etc/rc.d/named These are quite capable
of starting up the ports version of named. Just set

   named_command="/usr/local/sbin/named"

in /etc/rc.conf

Actually, given you *aren't* using the ports, where did
/usr/local/etc/rc.d/named come from?  That's supplied exclusively by the
port.

> However, if I try to check rndc…
> 
> # /usr/local/sbin/rndc status
> rndc: neither /etc/rndc.conf nor /etc/rndc.key was found
> 
> Now, it is true that there is no rndc.conf, but that is true all all three 
> name servers. There is a rndc.key in /var/named/etc/namedb/rndc.conf
> 
> I’m not sure why it is looking in (I assume /var/named/etc instead of)  
> /var/named/etc/namedb.
> 
> is named_chrootdir="/var/named" not correct?

There should be a symbolic link /etc/namedb -> /var/named/etc/namedb if
you're using the standard chroot setup in FreeBSD 8.4.  The default
location for rndc.conf is /etc/namedb/rndc.conf  but again, there would
usually be a symlink /etc/rndc.conf -> /etc/namedb/rndc.conf (which
means the actual location after chasing all the symlinks is
/var/named/etc/namedb/rndc.conf)  Similarly for rndc.key if you are
using that instead.

I usually added another symlink /usr/local/etc/rndc.conf ->
/etc/namedb/rndc.conf when using the ports version of named with the
system versions of the named configuration scripts.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.

PGP: http://www.infracaninophile.co.uk/pgpkey
JID: matt...@infracaninophile.co.uk



signature.asc
Description: OpenPGP digital signature
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: compile and install from source

2015-03-31 Thread Mathieu Arnold
+--On 30 mars 2015 19:32:09 -0600 "@lbutlr"  wrote:
|> # /usr/local/sbin/named -u bind -c /etc/namedb/named.conf \
|>  -t /var/named
| 
| Yes, that works without reporting any errors, so the issue appears to be
| with /usr/local/etc/rc.d/named startup script.

Well, your first post says you're using 8.4, so there should be no such
script, it should be in /etc/rc.d.

|> syslogd_flags="-l /var/named/var/run/log"
|> 
|> to /etc/rc.conf and restarting syslogd may get you some better logging
|> information.
| 
| Don’t see anything logged on either the startup or the failed startup.
| 
| However, if I try to check rndc…
| 
|# /usr/local/sbin/rndc status
| rndc: neither /etc/rndc.conf nor /etc/rndc.key was found

That's because you built named manually and not from ports, so it doesn't
know where it should find its bits.

| Now, it is true that there is no rndc.conf, but that is true all all
| three name servers. There is a rndc.key in /var/named/etc/namedb/rndc.conf
| 
| I’m not sure why it is looking in (I assume /var/named/etc instead of)
| /var/named/etc/namedb.

Because you built it manually so it did not get all the right configure
options the port has.

| is named_chrootdir="/var/named" not correct?

It is.

-- 
Mathieu Arnold
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: compile and install from source

2015-03-31 Thread Mathieu Arnold
+--On 30 mars 2015 17:13:15 -0700 Kevin Oberman  wrote:
| Note that chroot has just been re-enabled in the FreeBSD BIND ports. It's
| not default,  so you must select the CHROOT option. This was just
| announced last week, and I am not sure the change has actually been
| committed.

There is no CHROOT options, there is a named_chrootdir rc variable to
setup.  And it has been committed.  Trust me.

-- 
Mathieu Arnold
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: compile and install from source

2015-03-30 Thread @lbutlr
On Mar 30, 2015, at 2:30 AM, Matthew Seaman  
wrote:
> On 03/30/15 00:35, @lbutlr wrote:
>> Downloaded and compiled bind-9.9.7 (FreeBSD 8.4-RELEASE) and it built fine 
>> (./configure && make && make install).
> 
> On FreeBSD, building software out of the ports is definitely
> recommended.  It does the usual configure and make dance, but you also
> get the benefit of using the package management system, and any OS
> specific patches that might need to be applied.  (Not that there are
> many with BIND).

And I normally do that, however in this specific case it was not possible.

> Can you start the named process "by hand" -- the command line should be
> something like:
> 
> # /usr/local/sbin/named -u bind -c /etc/namedb/named.conf \
>   -t /var/named

Yes, that works without reporting any errors, so the issue appears to be with 
/usr/local/etc/rc.d/named startup script.

> syslogd_flags="-l /var/named/var/run/log"
> 
> to /etc/rc.conf and restarting syslogd may get you some better logging
> information.

Don’t see anything logged on either the startup or the failed startup.

However, if I try to check rndc…

# /usr/local/sbin/rndc status
rndc: neither /etc/rndc.conf nor /etc/rndc.key was found

Now, it is true that there is no rndc.conf, but that is true all all three name 
servers. There is a rndc.key in /var/named/etc/namedb/rndc.conf

I’m not sure why it is looking in (I assume /var/named/etc instead of)  
/var/named/etc/namedb.

is named_chrootdir="/var/named" not correct?


___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: compile and install from source

2015-03-30 Thread Kevin Oberman
On Mon, Mar 30, 2015 at 12:41 PM, Mathieu Arnold  wrote:

>
>
> +--On 30 mars 2015 19:12:30 +0200 Daniel Ryslink
>  wrote:
> |  > That's not true, it's just not enabled by default, because it is a
> | mess to
> |  > get *right* when migrating from {8,9} to 10.
> |
> | On the contrary, see the FreeBSD 10 release notes:
> |
> | https://www.freebsd.org/releases/10.0R/announce.html
> |
> | Quote:
> |
> | "- Unbound has been imported to the base system as the local caching DNS
> | resolver.
> |
> | - BIND has been removed from the base system."
> |
> | As for my rc.conf directives, they may be obsolete, but they still work.
>
> Ah, sorry, my "not true" was regarding the chroot thing.
>
> --
> Mathieu Arnold
> ___
> Please visit https://lists.isc.org/mailman/listinfo/bind-users to
> unsubscribe from this list
>
> bind-users mailing list
> bind-users@lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
>

Note that chroot has just been re-enabled in the FreeBSD BIND ports. It's
not default,  so you must select the CHROOT option. This was just announced
last week, and I am not sure the change has actually been committed.
--
Kevin Oberman, Network Engineer, Retired
E-mail: rkober...@gmail.com
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: compile and install from source

2015-03-30 Thread Mathieu Arnold


+--On 30 mars 2015 19:12:30 +0200 Daniel Ryslink
 wrote:
|  > That's not true, it's just not enabled by default, because it is a
| mess to
|  > get *right* when migrating from {8,9} to 10.
| 
| On the contrary, see the FreeBSD 10 release notes:
| 
| https://www.freebsd.org/releases/10.0R/announce.html
| 
| Quote:
| 
| "- Unbound has been imported to the base system as the local caching DNS
| resolver.
| 
| - BIND has been removed from the base system."
| 
| As for my rc.conf directives, they may be obsolete, but they still work.

Ah, sorry, my "not true" was regarding the chroot thing.

-- 
Mathieu Arnold
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: compile and install from source

2015-03-30 Thread Daniel Ryslink
> That's not true, it's just not enabled by default, because it is a 
mess to

> get *right* when migrating from {8,9} to 10.

On the contrary, see the FreeBSD 10 release notes:

https://www.freebsd.org/releases/10.0R/announce.html

Quote:

"- Unbound has been imported to the base system as the local caching DNS 
resolver.


- BIND has been removed from the base system."

As for my rc.conf directives, they may be obsolete, but they still work.

--
S pozdravem,
Daniel Ryšlink
System Administrator

Dial Telecom a. s.
Křižíkova 36a/237
186 00 Praha 3, Česká Republika
Tel.:+420.226204627
daniel.rysl...@dialtelecom.cz
---
www.dialtelecom.cz
Dial Telecom, a.s.
Jednoduše se připojte
---

On 03/30/2015 05:13 PM, Mathieu Arnold wrote:

+--On 30 mars 2015 16:46:36 +0200 Daniel Ryslink
 wrote:
| In 8.4., the default chroot for BIND is /var/named, you might want to use
| that. Please not that in FreeBSD 10, BIND is removed from system and
| replaced with Unbound as the default resolver, and the chroot in
| /var/named is gone, you have to make it manually.

That's not true, it's just not enabled by default, because it is a mess to
get *right* when migrating from {8,9} to 10.

| If you run Bind in chroot, you should have this in rc.conf:
|
| named_enable="YES"
| named_flags="-t /var/named"

Nope, you should use:
named_chrootdir="/var/named"

| syslogd_flags="-s -l /var/named/dev/log"

And I think that should be written as:

altlog_proglist="named"

| Use the rc script /usr/local/etc/rc.d/named to start and stop the BIND
| process.





___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: compile and install from source

2015-03-30 Thread Mathieu Arnold
+--On 30 mars 2015 16:46:36 +0200 Daniel Ryslink
 wrote:
| In 8.4., the default chroot for BIND is /var/named, you might want to use
| that. Please not that in FreeBSD 10, BIND is removed from system and
| replaced with Unbound as the default resolver, and the chroot in
| /var/named is gone, you have to make it manually.

That's not true, it's just not enabled by default, because it is a mess to
get *right* when migrating from {8,9} to 10.

| If you run Bind in chroot, you should have this in rc.conf:
| 
| named_enable="YES"
| named_flags="-t /var/named"

Nope, you should use:
named_chrootdir="/var/named"

| syslogd_flags="-s -l /var/named/dev/log"

And I think that should be written as:

altlog_proglist="named"

| Use the rc script /usr/local/etc/rc.d/named to start and stop the BIND
| process.



-- 
Mathieu Arnold
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: compile and install from source

2015-03-30 Thread Daniel Ryslink

Prefered procedure:

1) Install the ports collection via "portsnap fetch" and then "portsnap 
extract" (or "portsnap update" if already installed)

2) Go to /usr/ports/dns/bind99 and type "make install"

Please note that after installing, you will have two versions of BIND on 
your system:


- the default version of BIND that is installed with the system and 
resides in /usr/sbin/, config is in /etc/namedb. Don't try to overwrite 
this, it's not the right way to do it
- the version installed from ports or packages that resides in 
/usr/local/sbin/, config is in /usr/local/etc/. That's the version you 
want to use.


In 8.4., the default chroot for BIND is /var/named, you might want to 
use that. Please not that in FreeBSD 10, BIND is removed from system and 
replaced with Unbound as the default resolver, and the chroot in 
/var/named is gone, you have to make it manually.


If you run Bind in chroot, you should have this in rc.conf:

named_enable="YES"
named_flags="-t /var/named"
syslogd_flags="-s -l /var/named/dev/log"

Use the rc script /usr/local/etc/rc.d/named to start and stop the BIND 
process.


--
S pozdravem,
Daniel Ryšlink
System Administrator

Dial Telecom a. s.
Křižíkova 36a/237
186 00 Praha 3, Česká Republika
Tel.:+420.226204627
daniel.rysl...@dialtelecom.cz
---
www.dialtelecom.cz
Dial Telecom, a.s.
Jednoduše se připojte
---

On 03/30/2015 01:35 AM, @lbutlr wrote:

Downloaded and compiled bind-9.9.7 (FreeBSD 8.4-RELEASE) and it built fine (./configure 
&& make && make install).

If I try to start named (service named start), it starts this version instead 
of the version in /usr/local/sbin

I found this in /etc/defaults/rc,conf:

named_enable="NO"   # Run named, the DNS server (or NO).
named_program="/usr/sbin/named" # Path to named, if you want a different one.
named_conf="/etc/namedb/named.conf" # Path to the configuration file
#named_flags="" # Use this for flags OTHER than -u and -c
named_uid="bind"# User to run named as
named_chrootdir="/var/named"# Chroot directory (or "" not to auto-chroot it)
named_chroot_autoupdate="YES"   # Automatically install/update chrooted
   # components of named. See /etc/rc.d/named.
named_symlink_enable="YES"  # Symlink the chrooted pid file
named_wait="NO" # Wait for working name service before exiting
named_wait_host="localhost" # Hostname to check if named_wait is enabled
named_auto_forward="NO" # Set up forwarders from /etc/resolv.conf
named_auto_forward_only="NO"# Do "forward only" instead of "forward first”

So I changed the path (in /etc/rc.conf) to /usr/local/sbin/named

But now I get:

$ /etc/rc.d/named start
Starting named.
/etc/rc.d/named: WARNING: failed to start named

But nothing is logged in /var/log/messages

For now, I am pointing back to the old 9.8.4 version.



___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: compile and install from source

2015-03-30 Thread Mathieu Arnold
+--On 29 mars 2015 17:35:09 -0600 @lbutlr, krem...@kreme.com wrote:
| Downloaded and compiled bind-9.9.7 (FreeBSD 8.4-RELEASE) and it built
| fine (./configure && make && make install).

What does the port version not do that you need ?

| If I try to start named (service named start), it starts this version
| instead of the version in /usr/local/sbin
|
| So I changed the path (in /etc/rc.conf) to /usr/local/sbin/named

If you had installed the port, it would have told you that:

*   You will need to make sure that you have the following line  *
*   in your /etc/rc.conf in order to have the startup script *
*   run the named version from the port: *
**
*   named_program="/usr/local/sbin/named"*

| But now I get:
| 
| $ /etc/rc.d/named start
| Starting named.
| /etc/rc.d/named: WARNING: failed to start named
| 
| But nothing is logged in /var/log/messages
| 
| For now, I am pointing back to the old 9.8.4 version.

Have you tried running it manually to see what it says ?

-- 
Mathieu Arnold
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: compile and install from source

2015-03-30 Thread Jeremy C. Reed
On Sun, 29 Mar 2015, INVALID_ADDRESS wrote:
> named_conf="/etc/namedb/named.conf" # Path to the configuration file
...
> So I changed the path (in /etc/rc.conf) to /usr/local/sbin/named
> 
> But now I get:
> 
> $ /etc/rc.d/named start
> Starting named.
> /etc/rc.d/named: WARNING: failed to start named
> 
> But nothing is logged in /var/log/messages

Try running:

  /usr/local/sbin/named -g -c /etc/namedb/named.conf -u bind

to see what the output tells you.
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: compile and install from source

2015-03-30 Thread Matthew Seaman
On 03/30/15 00:35, @lbutlr wrote:
> Downloaded and compiled bind-9.9.7 (FreeBSD 8.4-RELEASE) and it built fine 
> (./configure && make && make install).

On FreeBSD, building software out of the ports is definitely
recommended.  It does the usual configure and make dance, but you also
get the benefit of using the package management system, and any OS
specific patches that might need to be applied.  (Not that there are
many with BIND).

> If I try to start named (service named start), it starts this version instead 
> of the version in /usr/local/sbin
> 
> I found this in /etc/defaults/rc,conf:
> 
> named_enable="NO"   # Run named, the DNS server (or NO).
> named_program="/usr/sbin/named" # Path to named, if you want a different one.
> named_conf="/etc/namedb/named.conf" # Path to the configuration file
> #named_flags="" # Use this for flags OTHER than -u and -c
> named_uid="bind"# User to run named as
> named_chrootdir="/var/named"# Chroot directory (or "" not to auto-chroot 
> it)
> named_chroot_autoupdate="YES"   # Automatically install/update chrooted
>   # components of named. See /etc/rc.d/named.
> named_symlink_enable="YES"  # Symlink the chrooted pid file
> named_wait="NO" # Wait for working name service before exiting
> named_wait_host="localhost" # Hostname to check if named_wait is enabled
> named_auto_forward="NO" # Set up forwarders from /etc/resolv.conf
> named_auto_forward_only="NO"# Do "forward only" instead of "forward first”
> 
> So I changed the path (in /etc/rc.conf) to /usr/local/sbin/named
> 
> But now I get:
> 
> $ /etc/rc.d/named start
> Starting named.
> /etc/rc.d/named: WARNING: failed to start named
> 
> But nothing is logged in /var/log/messages
> 
> For now, I am pointing back to the old 9.8.4 version.

It's been a while since I ran FreeBSD 8.4 on any nameservers, but I
recall it working fine using the ports version of named and the
configuration files from the base system.

Can you start the named process "by hand" -- the command line should be
something like:

   # /usr/local/sbin/named -u bind -c /etc/namedb/named.conf \
-t /var/named

(assuming you want it to run chrooted)

If you've setup named to log to syslog, rather than just writing its own
files, then adding

   syslogd_flags="-l /var/named/var/run/log"

to /etc/rc.conf and restarting syslogd may get you some better logging
information.

Cheers,

Matthew






signature.asc
Description: OpenPGP digital signature
___
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users