PR/49380: KAMADA Ken'ichi: ntpd_chrootdir does not work on NetBSD 7.0_BETA

Provide /etc/resolv.conf so that it can resolve names. This is needed because
of deferred name resolution.
XXX: pullup -7
This commit is contained in:
christos 2015-11-23 19:56:47 +00:00
parent 20725a9902
commit 0e5ab369bd
4 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1117 2015/11/11 07:48:41 ozaki-r Exp $
# $NetBSD: mi,v 1.1118 2015/11/23 19:56:47 christos Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@ -5877,6 +5877,7 @@
./var/chroot/named/var/tmp base-bind-root
./var/chroot/ntpd base-ntp-root
./var/chroot/ntpd/dev base-ntp-root
./var/chroot/ntpd/etc base-ntp-root
./var/chroot/ntpd/var base-ntp-root
./var/chroot/ntpd/var/db base-ntp-root
./var/chroot/ntpd/var/run base-ntp-root

View File

@ -1,4 +1,4 @@
# $NetBSD: NetBSD.dist.base,v 1.149 2015/09/03 22:24:02 youri Exp $
# $NetBSD: NetBSD.dist.base,v 1.150 2015/11/23 19:56:47 christos Exp $
# @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93
# Do not customize this file as it may be overwritten on upgrades.
@ -1268,6 +1268,7 @@
./var/chroot/named/var/tmp mode=01775 gname=named
./var/chroot/ntpd
./var/chroot/ntpd/dev
./var/chroot/ntpd/etc
./var/chroot/ntpd/var
./var/chroot/ntpd/var/db mode=0775 gname=ntpd
./var/chroot/ntpd/var/run mode=0775 gname=ntpd

View File

@ -1,4 +1,4 @@
# $NetBSD: special,v 1.152 2015/03/21 19:10:43 jmcneill Exp $
# $NetBSD: special,v 1.153 2015/11/23 19:56:47 christos Exp $
# @(#)special 8.2 (Berkeley) 1/23/94
#
# This file may be overwritten on upgrades.
@ -400,6 +400,7 @@
./var/chroot/named/var/tmp type=dir mode=01775 gname=named
./var/chroot/ntpd type=dir mode=0755
./var/chroot/ntpd/dev type=dir mode=0755
./var/chroot/ntpd/etc type=dir mode=0755
./var/chroot/ntpd/var type=dir mode=0755
./var/chroot/ntpd/var/db type=dir mode=0775 gname=ntpd
./var/chroot/ntpd/var/run type=dir mode=0775 gname=ntpd

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: ntpd,v 1.15 2014/12/25 23:00:18 spz Exp $
# $NetBSD: ntpd,v 1.16 2015/11/23 19:56:47 christos Exp $
#
# PROVIDE: ntpd
@ -53,6 +53,13 @@ ntpd_precmd()
if [ ! -d "${ntpd_chrootdir}/etc" ]; then
mkdir "${ntpd_chrootdir}/etc"
fi
for f in resolv.conf; do
if ! cmp -s "/etc/$f" "${ntpd_chrootdir}/etc/$f"; then
cp -p "/etc/$f" "${ntpd_chrootdir}/etc/$f"
fi
done
if [ ! -f "${ntpd_chrootdir}/etc/services" ]; then
getent services ntp/udp ntp/tcp \
> "${ntpd_chrootdir}/etc/services"