named: conditionally copy files to chroot (rc-script)
authorJan Lentfer <Jan.Lentfer@web.de>
Thu, 21 Jan 2010 21:43:12 +0000 (22:43 +0100)
committerJan Lentfer <Jan.Lentfer@web.de>
Thu, 21 Jan 2010 21:48:11 +0000 (22:48 +0100)
* script snippet brought in from FreeBSD

etc/rc.d/named

index 1ae94e2..bc07af8 100644 (file)
@@ -37,7 +37,12 @@ named_precmd()
        #       Change run_rc_commands()'s internal copy of $named_flags
        #
        rc_flags="-u $nuser -t ${named_chrootdir} $rc_flags"
-       cp /etc/localtime ${named_chrootdir}/etc
+       for file in localtime protocols services; do
+               if [ -r /etc/$file ]; then
+                       cmp -s /etc/$file "${named_chrootdir}/etc/$file" ||
+                           cp -p /etc/$file "${named_chrootdir}/etc/$file"
+               fi
+       done
 }
 
 load_rc_config $name