[net-dns/bind] sync
This commit is contained in:
parent
2d3920dd89
commit
b7aa1f2e70
@ -165,11 +165,11 @@ src_install() {
|
||||
pkg_postinst() {
|
||||
tmpfiles_process named.conf
|
||||
|
||||
if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
|
||||
if [[ -z ${ROOT} && ! -f ${EPREFIX}/etc/bind/rndc.key && ! -f ${EPREFIX}/etc/bind/rndc.conf ]]; then
|
||||
einfo "Generating rndc.key"
|
||||
/usr/sbin/rndc-confgen -a
|
||||
chown root:named /etc/bind/rndc.key || die
|
||||
chmod 0640 /etc/bind/rndc.key || die
|
||||
"${EPREFIX}"/usr/sbin/rndc-confgen -a || die
|
||||
chown root:named "${EPREFIX}"/etc/bind/rndc.key || die
|
||||
chmod 0640 "${EPREFIX}"/etc/bind/rndc.key || die
|
||||
fi
|
||||
|
||||
einfo
|
||||
@ -182,7 +182,7 @@ pkg_postinst() {
|
||||
einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`"
|
||||
einfo
|
||||
|
||||
CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT})
|
||||
CHROOT=$(source "${EROOT}"/etc/conf.d/named 2>/dev/null; echo ${CHROOT})
|
||||
if [[ -n ${CHROOT} ]]; then
|
||||
elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!"
|
||||
elog "To enable the old behaviour (without using mount) uncomment the"
|
||||
@ -208,9 +208,9 @@ pkg_postinst() {
|
||||
}
|
||||
|
||||
pkg_config() {
|
||||
CHROOT=$(source /etc/conf.d/named; echo ${CHROOT})
|
||||
CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT})
|
||||
CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP})
|
||||
CHROOT=$(source "${EROOT}"/etc/conf.d/named; echo ${CHROOT})
|
||||
CHROOT_NOMOUNT=$(source "${EROOT}"/etc/conf.d/named; echo ${CHROOT_NOMOUNT})
|
||||
CHROOT_GEOIP=$(source "${EROOT}"/etc/conf.d/named; echo ${CHROOT_GEOIP})
|
||||
|
||||
if [[ -z "${CHROOT}" ]]; then
|
||||
eerror "This config script is designed to automate setting up"
|
||||
@ -231,34 +231,34 @@ pkg_config() {
|
||||
|
||||
echo; einfo "Setting up the chroot directory..."
|
||||
|
||||
mkdir -m 0750 -p ${CHROOT} || die
|
||||
mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} || die
|
||||
mkdir -m 0750 -p ${CHROOT}/etc/bind || die
|
||||
mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ || die
|
||||
mkdir -m 0750 -p "${CHROOT}" || die
|
||||
mkdir -m 0755 -p "${CHROOT}"/{dev,etc,var/log,run} || die
|
||||
mkdir -m 0750 -p "${CHROOT}"/etc/bind || die
|
||||
mkdir -m 0770 -p "${CHROOT}"/var/{bind,log/named} "${CHROOT}"/run/named/ || die
|
||||
|
||||
chown root:named \
|
||||
${CHROOT} \
|
||||
${CHROOT}/var/{bind,log/named} \
|
||||
${CHROOT}/run/named/ \
|
||||
${CHROOT}/etc/bind \
|
||||
"${CHROOT}" \
|
||||
"${CHROOT}"/var/{bind,log/named} \
|
||||
"${CHROOT}"/run/named/ \
|
||||
"${CHROOT}"/etc/bind \
|
||||
|| die
|
||||
|
||||
mknod ${CHROOT}/dev/null c 1 3 || die
|
||||
chmod 0666 ${CHROOT}/dev/null || die
|
||||
mknod "${CHROOT}"/dev/null c 1 3 || die
|
||||
chmod 0666 "${CHROOT}"/dev/null || die
|
||||
|
||||
mknod ${CHROOT}/dev/zero c 1 5 || die
|
||||
chmod 0666 ${CHROOT}/dev/zero || die
|
||||
mknod "${CHROOT}"/dev/zero c 1 5 || die
|
||||
chmod 0666 "${CHROOT}"/dev/zero || die
|
||||
|
||||
if [[ "${CHROOT_NOMOUNT:-0}" -ne 0 ]]; then
|
||||
cp -a /etc/bind ${CHROOT}/etc/ || die
|
||||
cp -a /var/bind ${CHROOT}/var/ || die
|
||||
cp -a /etc/bind "${CHROOT}"/etc/ || die
|
||||
cp -a /var/bind "${CHROOT}"/var/ || die
|
||||
fi
|
||||
|
||||
if [[ "${CHROOT_GEOIP:-0}" -eq 1 ]]; then
|
||||
if use geoip; then
|
||||
mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP || die
|
||||
mkdir -m 0755 -p "${CHROOT}"/usr/share/GeoIP || die
|
||||
elif use geoip2; then
|
||||
mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP2 || die
|
||||
mkdir -m 0755 -p "${CHROOT}"/usr/share/GeoIP2 || die
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user