We need a directory for the PID, and put it in /var/run/named:
# mkdir /var/run/named # ls -ld /var/run/named drwxr-xr-x 2 root root 4096 Aug 3 07:58 /var/run/named # chown named /var/run/named # chgrp named /var/run/named # ls -ld /var/run/named drwxr-xr-x 2 named named 4096 Aug 3 07:58 /var/run/named # chmod 770 /var/run/named # ls -ld /var/run/named drwxrwx--- 2 named named 4096 Aug 3 07:58 /var/run/named # |
At this point, the only real difference between our newly compiled install and the FC6 RPM is where the PID is and the binaries. Here is a diff between the FC6 init file and ours showing where the paths changed:
# diff named /root/namedinit 35c35 < if [[ "$ENABLE_SDB" = [yY1]* ]] && [ -x /usr/local/sbin/named_sdb ]; then --- > if [[ "$ENABLE_SDB" = [yY1]* ]] && [ -x /usr/sbin/named_sdb ]; then 40c40 < [ -x /usr/local/sbin/$named ] || exit 1 --- > [ -x /usr/sbin/$named ] || exit 1 154c154 < if [ -x /usr/local/sbin/named-checkconf ] && [ -x /usr/local/sbin/named-checkzone ] && /usr/local/sbin/named-checkconf $ckcf_options ${named_conf} >/dev/null 2>&1; then --- > if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} >/dev/null 2>&1; then 160c160 < daemon /usr/local/sbin/$named -u named ${OPTIONS}; --- > daemon /usr/sbin/$named -u named ${OPTIONS}; 181c181 < named_err="`/usr/local/sbin/named-checkconf $ckcf_options $named_conf 2>&1`"; --- > named_err="`/usr/sbin/named-checkconf $ckcf_options $named_conf 2>&1`"; 199c199 < /usr/local/sbin/rndc stop >/dev/null 2>&1 --- > /usr/sbin/rndc stop >/dev/null 2>&1 244c244 < /usr/local/sbin/rndc status --- > /usr/sbin/rndc status 257c257 < /usr/local/sbin/rndc reload >/dev/null 2>&1 || /bin/kill -HUP $p; --- > /usr/sbin/rndc reload >/dev/null 2>&1 || /bin/kill -HUP $p; 267c267 < /usr/local/sbin/rndc reload >/dev/null 2>&1 || echo start --- > /usr/sbin/rndc reload >/dev/null 2>&1 || echo start 276c276 < if [ -x /usr/local/sbin/named-checkconf ] && [ -x /usr/local/sbin/named-checkzone ] && /usr/local/sbin/named-checkconf $ckcf_options ${named_conf} | cat ; then --- > if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} | cat ; then # |
Let’s try and start the service:
# /etc/init.d/named start Starting named: [ OK ] # # tail -f /var/log/messages Aug 3 12:26:37 ip-5.5.5.5 named[7181]: starting BIND 9.5.0-P2 -u named Aug 3 12:26:37 ip-5.5.5.5 named[7181]: loading configuration from '/etc/named.conf' Aug 3 12:26:37 ip-5.5.5.5 named[7181]: no IPv6 interfaces found Aug 3 12:26:37 ip-5.5.5.5 named[7181]: listening on IPv4 interface lo, 127.0.0.1#53 Aug 3 12:26:37 ip-5.5.5.5 named[7181]: listening on IPv4 interface venet0:0, 5.5.5.5#53 Aug 3 12:26:37 ip-5.5.5.5 named[7181]: listening on IPv4 interface venet0:1, 5.5.5.6#53 Aug 3 12:26:37 ip-5.5.5.5 named[7181]: default max-cache-size (33554432) applies Aug 3 12:26:37 ip-5.5.5.5 named[7181]: default max-cache-size (33554432) applies: view _bind Aug 3 12:26:37 ip-5.5.5.5 named[7181]: command channel listening on 127.0.0.1#953 # ps -ef | grep named named 27770 1 0 Jun16 ? 00:00:00 /usr/local/sbin/named -u named root 28367 27991 0 Jun16 pts/0 00:00:00 grep named # |
Looks good!