Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 284957 Details for
Bug 362535
net-misc/dhcp-4.2.1-r1 init script is not suitable for chroot usage
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
dhcpd.init4
dhcpd.init4 (text/plain), 2.82 KB, created by
SpanKY
on 2011-08-29 04:57:36 UTC
(
hide
)
Description:
dhcpd.init4
Filename:
MIME Type:
Creator:
SpanKY
Created:
2011-08-29 04:57:36 UTC
Size:
2.82 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2011 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init3,v 1.1 2011/03/05 23:59:20 vapier Exp $ > >opts="configtest" > >: ${DHCPD_CONF:=/etc/dhcp/${SVCNAME}.conf} > >depend() { > need net > use logger dns >} > >get_var() { > # we read the conf outside of the chroot as we do > # not configure with --enable-early-chroot > local var="$(sed -n 's/^[[:blank:]]\?'"$1"' "*\([^#";]\+\).*/\1/p' "${DHCPD_CONF}")" > echo ${var:-$2} >} > >checkconfig() { > set -- ${DHCPD_OPTS} ${chroot:+-chroot} ${chroot} -t > > dhcpd "$@" 1>/dev/null 2>&1 > local ret=$? > if [ ${ret} -ne 0 ] ; then > eerror "${SVCNAME} has detected a syntax error in your configuration files:" > dhcpd "$@" > fi > > return ${ret} >} > >configtest() { > local chroot=${DHCPD_CHROOT} > > ebegin "Checking ${SVCNAME} configuration" > checkconfig > eend $? >} > >start() { > local chroot=${DHCPD_CHROOT} > > # Work out our cffile if it's in our DHCPD_OPTS > case " ${DHCPD_OPTS} " in > *" -cf "*) > DHCPD_CONF=" ${DHCPD_OPTS} " > DHCPD_CONF="${DHCPD_CONF##* -cf }" > DHCPD_CONF="${DHCPD_CONF%% *}" > ;; > *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}" > ;; > esac > > # see comment in get_var() above > if [ ! -f "${DHCPD_CONF}" ] ; then > eerror "${DHCPD_CONF} does not exist" > return 1 > fi > > if [ -n "${chroot}" ] ; then > # the config test want's these to exist > mkdir -p "${chroot}"/var/run/dhcp "${chroot}"/var/lib/dhcp > fi > > checkconfig || return 1 > > checkpath -d -o dhcp:dhcp "${chroot}"/var/run/dhcp "${chroot}"/var/lib/dhcp > > local leasefile="$(get_var lease-file-name /var/lib/dhcp/${SVCNAME}.leases)" > checkpath -f -o dhcp:dhcp "${chroot}${leasefile}" > > # Setup LD_PRELOAD so name resolution works in our chroot. > if [ -n "${chroot}" ] ; then > checkpath -d -o root:root -m 755 "${chroot}"/dev "${chroot}"/etc "${chroot}"/proc > cp -pP /etc/localtime /etc/resolv.conf "${chroot}"/etc/ > export LD_PRELOAD="${LD_PRELOAD} libresolv.so libnss_dns.so" > if ! mountinfo -q "${chroot}/proc" ; then > mount --bind /proc "${chroot}/proc" > fi > fi > > local pidfile="$(get_var pid-file-name /var/run/dhcp/${SVCNAME}.pid)" > > ebegin "Starting ${chroot:+chrooted }${SVCNAME}" > start-stop-daemon --start --exec /usr/sbin/dhcpd \ > --pidfile "${chroot}/${pidfile}" \ > -- ${DHCPD_OPTS} -q -pf "${pidfile}" -lf "${leasefile}" \ > -user dhcp -group dhcp \ > ${chroot:+-chroot} ${chroot} ${DHCPD_IFACE} > eend $? \ > && save_options chroot "${chroot}" \ > && save_options pidfile "${pidfile}" >} > >stop() { > local chroot="$(get_options chroot)" > > ebegin "Stopping ${chroot:+chrooted }${SVCNAME}" > start-stop-daemon --stop --exec /usr/sbin/dhcpd \ > --pidfile "${chroot}/$(get_options pidfile)" > res=$? > > if [ ${res} -eq 0 ] && [ -n "${chroot}" ] ; then > if mountinfo -q "${chroot}/proc" ; then > umount "${chroot}/proc" > fi > fi > > eend $res >}
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 Raw
Actions:
View
Attachments on
bug 362535
:
268933
|
268937
|
268939
| 284957