/etc/rc.d/named minor problems.

From: Jose M Rodriguez <josemi_at_freebsd.jazztel.es>
Date: Thu, 11 Nov 2004 20:14:34 +0100
I founs some minor problems with /etc/rc.d/named in 5.3RC1 and work a
patch on this.  I think this must be vaild for HEAD.

- add a ${named_chroot_mtree}, so /etc/mtree/BIND.chroot.dist don't
 need rewrite to alter chroot layout.

- supress /etc/named link code.  This don't seems really needed here.
Also, detect problems with this.  IMHO, this must be carefully take in
installworld/mergemaster.

- move devfs code to named_precmd.  This seems to be needed in any
 case, not only in chroot autoupdate.

patch attached.

--
  josemi

---- patch-bind
--- etc/rc.d/named.orig Wed Oct 20 08:30:58 2004
+++ etc/rc.d/named Wed Oct 20 08:31:19 2004
_at__at_ -30,36 +30,16 _at__at_
 {
  # Create (or update) the chroot directory structure
  #
- if [ -f /etc/mtree/BIND.chroot.dist ]; then
-  mtree -deU -f /etc/mtree/BIND.chroot.dist \
+ if [ -f ${named_chroot_mtree:-/etc/mtree/BIND.chroot.dist} ]; then
+  mtree -deU -f ${named_chroot_mtree} \
       -p ${named_chrootdir}
  else
-  warn "/etc/mtree/BIND.chroot.dist missing,"
+  warn "${named_chroot_mtree} missing,"
   warn "chroot directory structure not updated"
  fi
 
  # Create /etc/namedb symlink
- #
- if [ ! -L /etc/namedb ]; then
-  if [ -d /etc/namedb ]; then
-   warn "named chroot: /etc/namedb is a directory!"
-  elif [ -e /etc/namedb ]; then
-   warn "named chroot: /etc/namedb exists!"
-  else
-   ln -s ${named_chrootdir}/etc/namedb /etc/namedb
-  fi
- fi
-
- # Mount a devfs in the chroot directory if needed
- #
- if [ ! -c ${named_chrootdir}/dev/random -o \
-     ! -c ${named_chrootdir}/dev/null ]; then
-  umount ${named_chrootdir}/dev 2>/dev/null
-  mount_devfs devfs ${named_chrootdir}/dev
- fi
- devfs -m ${named_chrootdir}/dev rule apply hide
- devfs -m ${named_chrootdir}/dev rule apply path null unhide
- devfs -m ${named_chrootdir}/dev rule apply path random unhide
+ # this must be a mergemaster task
 
  # Copy local timezone information if it is not up to date.
  #
_at__at_ -87,6 +67,16 _at__at_
   rc_flags="$rc_flags -t $named_chrootdir"
   confgen_chroot="-t${named_chrootdir} -u bind"
   checkyesno named_chroot_autoupdate && chroot_autoupdate
+  # Mount a devfs in the chroot directory if needed
+  #
+  if [ ! -c ${named_chrootdir}/dev/random -o \
+   ! -c ${named_chrootdir}/dev/null ]; then
+   umount ${named_chrootdir}/dev 2>/dev/null
+   mount_devfs devfs ${named_chrootdir}/dev
+  fi
+  devfs -m ${named_chrootdir}/dev rule apply hide
+  devfs -m ${named_chrootdir}/dev rule apply path null unhide
+  devfs -m ${named_chrootdir}/dev rule apply path random unhide
  else
   named_symlink_enable=NO
  fi
Received on Thu Nov 11 2004 - 18:14:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:21 UTC