bind symbolic link turning red post named restart
Solution 1:
Starting bind
/named
runs /usr/sbin/named.init
.
In there, is a function called checkAndCopyConfigFiles
.
In there is the line rm -f ${CHROOT_PREFIX}/${configfile}
You made a symlink from /etc/named.conf
to /var/lib/named/etc/named.conf
, now when that script runs, it deleted /var/lib/named/etc/named.conf
.
So, the script deleted /var/lib/named/etc/named.conf
, and attempted to copy the endpoint of the symlink, /etc/named.conf
, which no longer exists, since it has already deleted it.
This results in a dangling symlink reference and hence turns red
.
Your crafted named.conf
no longer exists.
If you can get it back, you have 3 choices.
- Have your code alter the
/etc/named.conf
and any other files within/etc/
rather than within/var/lib/named/etc
. - Edit
/usr/sbin/named.init
and craft your own which handles such a situation. - Remove
bind-chrootenv
and craft your own startup script.