Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 195948 Details for
Bug 275684
net-dns/bind chroot improvement suggestion
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
init.patch
init.patch (text/plain), 1.96 KB, created by
Christian Ruppert (idl0r)
on 2009-06-28 13:07:30 UTC
(
hide
)
Description:
init.patch
Filename:
MIME Type:
Creator:
Christian Ruppert (idl0r)
Created:
2009-06-28 13:07:30 UTC
Size:
1.96 KB
patch
obsolete
>--- files/named.init-r5 2009-06-27 12:00:27.000000000 +0200 >+++ /etc/init.d/named 2009-06-27 18:28:32.000000000 +0200 >@@ -11,6 +11,41 @@ depend() { > provide dns > } > >+_mount() { >+ local from >+ local to >+ local opts >+ >+ if [[ $# -lt 3 ]]; >+ then >+ eerror "_mount(): to few arguments" >+ return 1 >+ fi >+ >+ from=$1 >+ to=$2 >+ shift 2 >+ >+ opts="${*}" >+ shift $# >+ >+ if [[ -z $(grep "${to}" /proc/mounts) ]]; >+ then >+ einfo "mounting ${from} to ${to}" >+ mount ${from} ${to} ${opts} || return 1 >+ fi >+} >+ >+_umount() { >+ local dir=$1 >+ >+ if [[ -n $(grep "${dir}" /proc/mounts) ]]; >+ then >+ einfo "umount ${dir}" >+ umount ${dir} >+ fi >+} >+ > checkconfig() { > if [ ! -f ${CHROOT}/etc/bind/named.conf ] ; then > eerror "No ${CHROOT}/etc/bind/named.conf file exists!" >@@ -35,7 +70,18 @@ checkconfig() { > > start() { > ebegin "Starting ${CHROOT:+chrooted }named" >+ >+ if [[ -n ${CHROOT} ]]; >+ then >+ einfo "Mounting chroot dirs" >+ _mount none ${CHROOT}/proc -t proc >+ _mount /etc/bind ${CHROOT}/etc/bind -o bind >+ _mount /var/bind ${CHROOT}/var/bind -o bind >+ _mount /var/log/named ${CHROOT}/var/log/named -o bind >+ fi >+ > checkconfig || return 1 >+ > start-stop-daemon --start --quiet --pidfile ${PIDFILE} \ > --nicelevel ${NAMED_NICELEVEL:-0} \ > --exec /usr/sbin/named \ >@@ -44,6 +90,8 @@ start() { > } > > stop() { >+ local reported=0 >+ > ebegin "Stopping ${CHROOT:+chrooted }named" > checkconfig || return 2 > if [ -f $KEY ] ; then >@@ -52,6 +100,28 @@ stop() { > start-stop-daemon --stop --quiet --pidfile $PIDFILE \ > --exec /usr/sbin/named -- stop > fi >+ >+ if [[ -n ${CHROOT} ]]; >+ then >+ einfo "Umounting chroot dirs" >+ >+ # just to be sure everything gets clean >+ while [[ -n $(fuser ${CHROOT} 2>&1) ]] >+ do >+ if [[ ${reported} -eq 0 ]]; >+ then >+ einfo "Waiting until all named processes are stopped" >+ reported=1 >+ fi >+ sleep 1 >+ done >+ >+ _umount ${CHROOT}/etc/bind >+ _umount ${CHROOT}/var/log/named >+ _umount ${CHROOT}/var/bind >+ _umount ${CHROOT}/proc >+ fi >+ > eend $? > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 275684
:
195947
| 195948