Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 1749 Details for
Bug 4092
Error in the DHCPCD settings in the default /etc/init.d/net.eth0 script
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
The corrected /etc/init.d/net.eth0 file
net.eth0 (text/plain), 3.20 KB, created by
dynamotwain
on 2002-06-24 09:34:27 UTC
(
hide
)
Description:
The corrected /etc/init.d/net.eth0 file
Filename:
MIME Type:
Creator:
dynamotwain
Created:
2002-06-24 09:34:27 UTC
Size:
3.20 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2002 Gentoo Technologies, Inc. ># Distributed under the terms of the GNU General Public License, v2 or later ># $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.eth0,v 1.15 2002/05/10 21:57:44 azarah Exp $ > >#NB: Config is in /etc/conf.d/net > > >#for pcmcia users. note that pcmcia must be added to the same >#runlevel as the net.* script that needs it. >#depend() { ># use pcmcia >#} > >checkconfig() { > if [ -z "$(eval echo \$\{iface_${IFACE}\})" ] > then > eerror "Please make sure that /etc/conf.d/net has \$iface_$IFACE set" > return 1 > fi >} > >start() { > checkconfig || return 1 > local iface_args="$(eval echo \$\{iface_${IFACE}\})" > local dhcp_args="$(eval echo \$\{dhcpcd_${IFACE}\})" > local retval=0 > ebegin "Bringing ${IFACE} up" > if [ "$(eval echo \$\{iface_${IFACE}\})" != "dhcp" ] > then > /sbin/ifconfig ${IFACE} ${iface_args} >/dev/null || { > retval=$? > eend ${retval} "Failed to bring ${IFACE} up" > return ${retval} > } > else > /sbin/dhcpcd ${dhcp_args} ${IFACE} >/dev/null || { > retval=$? > eend ${retval} "Failed to bring ${IFACE} up" > return ${retval} > } > fi > eend 0 > > if [ -n "$(eval echo \$\{alias_${IFACE}\})" ] > then > local x="" > local num=0 > local aliasbcast="" > local aliasnmask="" > > if [ -n "`eval echo \$\{broadcast_${IFACE}\}`" ] > then > aliasbcast="broadcast `eval echo \$\{broadcast_${IFACE}\}`" > fi > > if [ -n "`eval echo \$\{netmask_${IFACE}\}`" ] > then > aliasnmask="netmask `eval echo \$\{netmask_${IFACE}\}`" > fi > > ebegin " Adding aliases" > for x in $(eval echo \$\{alias_${IFACE}\}) > do > ebegin " ${IFACE}:${num}" > /sbin/ifconfig ${IFACE}:${num} ${x} \ > ${aliasbcast} ${aliasnmask} >/dev/null > num=$((num + 1)) > eend 0 > done > save_options "alias" "$(eval echo \$\{alias_${IFACE}\})" > fi > > if [ -n "${gateway}" ] && [ "${gateway%/*}" = "${IFACE}" ] > then > ebegin " Setting default gateway" > /sbin/route add default gw ${gateway#*/} dev ${gateway%/*} \ > netmask 0.0.0.0 metric 1 >/dev/null || { > > local error=$? > ifconfig ${IFACE} down &>/dev/null > eend ${error} "Failed to bring ${IFACE} up" > return ${error} > } > eend 0 > fi > > #enabling rp_filter causes wacky packets to be auto-dropped by > #the kernel > > if [ -e /proc/sys/net/ipv4/conf/${IFACE}/rp_filter ] > then > echo 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter > fi >} > >stop() { > local myalias="$(get_options alias)" > ebegin "Bringing ${IFACE} down" > #do some cleanup in case the amount of aliases change > if [ -n "${myalias}" ] > then > local x="" > local num=0 > for x in ${myalias} > do > /sbin/ifconfig ${IFACE}:${num} down &>/dev/null > num=$((num + 1)) > done > fi > > if [ "$(eval echo \$\{iface_${IFACE}\})" == "dhcp" ] > then > #Incorrect way to shutdown dhcpcd > #/sbin/dhcpcd -k ${IFACE} &>/dev/null > #Correct way to shutdown dhcpcd: Send SIGTERM, and it won't release IP Address > #Extract pid from pid file automatically created > local pid=`cat /var/run/dhcpcd-$IFACE.pid` > kill -s SIGTERM $pid > > # Give dhcpcd time to properly shutdown > local count=0 > einfon " Waiting for dhcpcd to shutdown" > while [ "${count}" -lt 5 ] > do > echo -n "." > sleep 1 > count=$((count + 1)) > done > echo "done" > else > /sbin/ifconfig ${IFACE} down &>/dev/null > fi > eend 0 >} > > ># vim:ts=4
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 4092
: 1749