Anonymous | Login | Signup for a new account | 11-10-2008 10:53 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0000548 | [udhcp] | minor | N/A | 11-16-05 15:28 | 02-12-08 13:00 | ||||
Reporter | akvadrako | View Status | public | ||||||
Assigned To | |||||||||
Priority | normal | Resolution | no change required | ||||||
Status | closed | ||||||||
Summary | 0000548: Fix a couple issues with sample simple udhcp script | ||||||||
Description |
There are some problems with the current simple udhcp sample script. 1. /etc/resolv.conf is deleted, then created. This doesn't work if it's a symlink because it's on a read-only filesystem. It should just to overwritten. 2. When eth0 is up, and has a default gateway, then eth1 comes up with udhcp, it shouldn't create a seconds default gateway. I don't think having a second default gateway is ever useful. Either delete the old one or suppress the new one. I opted for the second choice. 3. Normally, udhcp is run as a daemon. Therefor the output should go to syslog. So pipe the output of the script to logger. Better would be to modify udhcp to cature this output so as not to depend upon logger. |
||||||||
Additional Information |
#!/bin/sh # udhcpc script edited by Tim Riker <Tim@Rikers.org> and Devin Bayer [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 { # redirect to logger RESOLV_CONF="/etc/resolv.conf" [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$subnet" ] && NETMASK="netmask $subnet" case "$1" in deconfig) /sbin/ifconfig $interface 0.0.0.0 ;; renew|bound) /sbin/ifconfig $interface $ip $BROADCAST $NETMASK if [ -n "$router" ] ; then echo "deleting routers for interface $interface" while route -n del default gw 0.0.0.0 dev $interface 2> /dev/null; do true done if route -n | egrep "^0.0.0.0"; then echo "default route already in place" else echo "adding default router $router" route add default gw $router dev $interface fi fi if (! grep -q -v DISABLE_DHCP $RESOLV_CONF) && echo -n > $RESOLV_CONF; then [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF for i in $dns ; do echo adding dns $i echo nameserver $i >> $RESOLV_CONF done fi ;; esac } 2>&1 | ( logger -s -p daemon.info -t uhdcp || cat ) exit 0 |
||||||||
Attached Files | |||||||||
|
Copyright © 2000 - 2006 Mantis Group |