From 2c3e272fbe28c2dfebedccd28a1c32893e33b297 Mon Sep 17 00:00:00 2001 From: Jan Lentfer Date: Thu, 21 Jan 2010 22:43:12 +0100 Subject: [PATCH] named: conditionally copy files to chroot (rc-script) * script snippet brought in from FreeBSD --- etc/rc.d/named | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/rc.d/named b/etc/rc.d/named index 1ae94e2b72..bc07af861e 100644 --- a/etc/rc.d/named +++ b/etc/rc.d/named @@ -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 -- 2.41.0